Skip to content
This repository has been archived by the owner on Sep 21, 2018. It is now read-only.

Remove NPM minification from StarterWeb and replace with Bundler & Mi… #592

Closed
wants to merge 1 commit into from

Conversation

phenning
Copy link
Contributor

@phenning phenning commented Jun 6, 2016

@peterblazejewicz
Copy link
Contributor

This assumes that all people install VS extension, correct? And when project is moved out of VS what then?

@phenning
Copy link
Contributor Author

phenning commented Jun 6, 2016

It actually works quite nicely without the VS extension, the BundlerMinifer runs as a precompile command.

@peterblazejewicz
Copy link
Contributor

It actually works quite nicely without the VS extension, the BundlerMinifer runs as a precompile command.

Can you provide some info, link please, I know only its use in VS context (so as an extension: http://madskristensen.net/post/bundling-minification-and-client-side-compilation).

@phenning
Copy link
Contributor Author

phenning commented Jun 6, 2016

The dotnetcore1.0 tool project was just published.

https://www.nuget.org/packages/BundlerMinifier.Core/

@phenning
Copy link
Contributor Author

phenning commented Jun 7, 2016

Merged

@phenning phenning closed this Jun 7, 2016
peterblazejewicz added a commit to peterblazejewicz/generator-aspnet that referenced this pull request Jun 7, 2016
This commit brings changes from aspnet/Templates#592
to starter web project template. The Gulp, Grunt options
are removed with NPM support removal.

Thanks!
peterblazejewicz added a commit to peterblazejewicz/generator-aspnet that referenced this pull request Jun 7, 2016
This commit brings changes from aspnet/Templates#592
to starter web project template. The Gulp, Grunt options
are removed with NPM support removal.

Thanks!
@peterblazejewicz
Copy link
Contributor

peterblazejewicz commented Jun 7, 2016

It actually works quite nicely without the VS extension, the BundlerMinifer runs as a precompile command.

I've started to port this changes to generator-aspnet and I cannot get this tool to run in the same fashio as dotnet-watch tool. Running dotnet bundle does nothing:

dotnet bundle
No executable found matching command "dotnet-bundle"

The tool and dependencies are installed correctly:

dotnet restore
log  : Restoring packages for /Users/piotrblazejewicz/development/WebApplicationBasic/project.json...
info :   CACHE https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/index.json
info :   CACHE https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethost/index.json
log  : Restoring packages for tool 'BundlerMinifier.Core' in /Users/piotrblazejewicz/development/WebApplicationBasic/project.json...
log  : Restoring packages for tool 'Microsoft.AspNetCore.Razor.Tools' in /Users/piotrblazejewicz/development/WebApplicationBasic/project.json...
log  : Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in /Users/piotrblazejewicz/development/WebApplicationBasic/project.json...
info : Committing restore...
log  : Writing lock file to disk. Path: /Users/piotrblazejewicz/development/WebApplicationBasic/project.lock.json
log  : /Users/piotrblazejewicz/development/WebApplicationBasic/project.json
log  : Restore completed in 3240ms.

NuGet Config files used:
    /Users/piotrblazejewicz/.nuget/NuGet/NuGet.Config

Feeds used:
    https://api.nuget.org/v3/index.json

Am I missing something? Does bundle require different dotnet version not yet released?
Thanks!

@madskristensen
Copy link
Contributor

madskristensen commented Jun 7, 2016

@peterblazejewicz You have to execute the command in the same working directory as the location of project.json. Here's what the VSCode tasks.json looks like that works:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "0.1.0",
    "command": "dotnet",
    "options": {
        "cwd": "${workspaceRoot}/src/bundlertest"
    },
    "isShellCommand": true,
    "showOutput": "always",
    "tasks": [
        {
            "taskName": "bundle",
            "isBuildCommand": true
        },
        {
            "taskName": "clean",
            "suppressTaskName": true,
            "args": [ "bundle", "clean" ]
        }
    ]
}

dotnet bundle runs on RC2. Make sure you have the latest nuget package version 2.0.200 or later. That's when the command changed from dotnet bundlerminifier to dotnet bundle.

@peterblazejewicz
Copy link
Contributor

Make sure you have the latest nuget package version 2.0.200 or later.

This is it. OK. Now the bundle seems to work, but it fails with path translation:

WebApplicationBasic dotnet bundle
Running with configuration from /Users/piotrblazejewicz/development/WebApplicationBasic/bundleconfig.json
Processing wwwroot/css/site.css
Could not find file '/Users/piotrblazejewicz/development/WebApplicationBasic/\Users\piotrblazejewicz\development\WebApplicationBasic\wwwroot\css\site.css'.

The paths are correctly defined in configuration file (taken literally from aspnet/Templates).

@peterblazejewicz
Copy link
Contributor

@madskristensen btw: Thanks!

peterblazejewicz added a commit to peterblazejewicz/generator-aspnet that referenced this pull request Jun 7, 2016
This commit brings changes from aspnet/Templates#592
to starter web project template. The Gulp, Grunt options
are removed with NPM support removal.

Thanks!
@madskristensen
Copy link
Contributor

@mlorbetske Something seems to be wrong with path translation as @peterblazejewicz describes. Any ideas?

@mlorbetske
Copy link
Contributor

@peterblazejewicz can you try with the latest package from NuGet?

@peterblazejewicz
Copy link
Contributor

@mlorbetske
Yes, already did. It's fixed:
madskristensen/BundlerMinifier#130
Thanks!

peterblazejewicz added a commit to peterblazejewicz/generator-aspnet that referenced this pull request Jun 9, 2016
This commit brings changes from aspnet/Templates#592
to web project template. The Gulp, Grunt options
are removed with NPM support removal.

Thanks!
peterblazejewicz added a commit to peterblazejewicz/generator-aspnet that referenced this pull request Jun 9, 2016
Afte adding Bundler support from aspnet/Templates#592
the --grunt option has no purpose
peterblazejewicz added a commit to OmniSharp/generator-aspnet that referenced this pull request Jun 10, 2016
* Introduce Bundler to web basic (StarterWeb) template

This commit brings changes from aspnet/Templates#592
to starter web project template. The Gulp, Grunt options
are removed with NPM support removal.

Thanks!

* ⬆️ Update Bundler version

The 2.0.208 fixes *nix paths problem

* Add missing Bundle to Semantic UI overrides

* Set post-install of NPM to false

* Fix output path names
peterblazejewicz added a commit to OmniSharp/generator-aspnet that referenced this pull request Jun 10, 2016
This commit brings changes from aspnet/Templates#592
to web project template. The Gulp, Grunt options
are removed with NPM support removal.

Thanks!
peterblazejewicz added a commit to OmniSharp/generator-aspnet that referenced this pull request Jun 10, 2016
Afte adding Bundler support from aspnet/Templates#592
the --grunt option has no purpose
@phenning phenning deleted the phenning/removeNPM branch June 14, 2016 18:43
@ikourfaln
Copy link

ikourfaln commented Jun 21, 2016

this is wrong, We need Gulp functionalities !! you must follow OSS trends
What about front-end developers !!

@madskristensen
Copy link
Contributor

More details on using the BundlerMinifier here https://github.com/madskristensen/BundlerMinifier/wiki

@ikourfaln
Copy link

thanx @peterblazejewicz , but I saw this episode before, but I dont understand why they remove Gulp and some other good Tools !!

@gulbanana
Copy link

you can still use gulp if you like. it has only been removed from the default template

@peterblazejewicz
Copy link
Contributor

@ikourfaln I'm afraid they have received negative feedback from C# dev about Gulp and other tools. I can tell this from my work experience (most of other devs never used Gulp/Grunt/etc) but did used some kind of tool integrated with VS, so Bundler in my opinion is some kind of trade-off. That's quite easy to replace it back with Gulp or other tool (I have this already in a project taken from other developer written with Polymer library - the Bundler didn't cut).
We have moved Bundler to generator-aspnet - as it seems to work quite nice out-of-the box x-platform. So when starting a Template based project users do have to install only Bower related deps - not NPM (less stress for starters)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants