Dica-Developer / generator-node-webkit

Yeoman generator for nwjs applications
MIT License
282 stars 40 forks source link

Selective node_modules #63

Closed Yimiprod closed 9 years ago

Yimiprod commented 9 years ago

For the need of my project, i have installed via npm some new node_modules, when packaging the apply, it take all the node_module folder, grunt included, instead of only the minified version of the modules i need.

How i can modify my gruntfile to do that for a windows / mac app build?

mschaaf commented 9 years ago

One solution could be to add a task to the grunt file that goes over the dist folder right after copying all files to it and remove all not minified files from it. If all your inlcuded/minified files contain something like .min. in there name then you could remove all not so named.

Yimiprod commented 9 years ago

I have found another solution, using grunt too, i've added wiredep and usemin. Wiredep add script tag and css link in my html. Then useminPrepare take the path and store all the js/css in a .tmp folder. Grunt copy my html/fonts/images/package.json in a buildApp folder. Usemin minify my css and js from .tmp and copy thoses minified files int buildApp folder.

Then all the grunt appbuild take the app from buildApp folder instead of the app folder.

If you want i can copy paste the final gruntfile, i'm going to upgrade it to do the same, later, with the node_modules.

mschaaf commented 9 years ago

It would be nice if you could add a pull request with some template added using your solution. Thank you sounds good to me.