perchlabs / webird

Webird
98 stars 22 forks source link

Webird takes too long to build the webpack bundles #1

Closed dschissler closed 9 years ago

dschissler commented 9 years ago

Currently it takes quite a while to build the webpack bundles. It takes too long!!!

dschissler commented 9 years ago

No problem maaan. Relax. Out of the box Webird is compiling examples for both Angular and Backbone Marionette and if you are not going to be using one of these then you can remove any part of that code. If you want to temporarily disable an entry point then place a # character at the beginning of the entry file name to stop it from being included.

For example, to disable the Angular entry:

Change ./app/webpack/angular.coffee to ./app/webpack/#angular.coffee.

In the starting configuration angular.coffee is the only file that is loading the Angular modules and so Webpack will not build Angular into the final bundles. I recommend that you read about the virtues of Webpack. Its a browserify competitor but is much more versatile for creating custom and heavily integrated solutions like Webird.

dschissler commented 9 years ago

Additionally Webird comes configured to compile LESS, SASS and Stylus. It is somewhat unlikely that you will want to support more than one CSS variant and so you can delete these from you ./dev/package.json and then also remove relevant settings from ./dev/gulp.webpack.coffee. By simply removing SASS I was able to save 30MB of files from node_modules.

Well trust me, its a lot easier to cut the stuff out that you don't need then it is to configure it to begin with.