These are chat archives for AngularClass/NG6-starter

5th
Aug 2016
T-G-G
@T-G-G
Aug 05 2016 13:51
Hey people prob a noob question but can anyone tell me why webpack is including loads of es6 and es7 modules into the dist code??
Sergey Protko
@fesor
Aug 05 2016 13:55
@T-G-G what do you mean?
T-G-G
@T-G-G
Aug 05 2016 13:56
This message was deleted
    new webpack.optimize.CommonsChunkPlugin({
      name: 'vendor',
      minChunks: function (module, count) {
        //console.log(module.rawRequest);
        console.log(module.resource);
        return module.resource && module.resource.indexOf(path.resolve(__dirname, 'client')) === -1;
      }
    })
If you look at the logs of that shows all kinda es6 and 7 stuff being webpacked and the bundles seem comparatively huge compared to vanilla angular stuff.
T-G-G
@T-G-G
Aug 05 2016 14:05
    new webpack.optimize.CommonsChunkPlugin({
      name: 'vendor',
      minChunks: function (module, count) {
        //console.log(module.rawRequest);
        console.log(module.resource);
        return module.resource && module.resource.indexOf(path.resolve(__dirname, 'client')) === -1;
      }
    })
If you look at the logs of that shows all kinda es6 and 7 stuff being webpacked and the bundles seem comparatively huge compared to vanilla angular stuff.
T-G-G
@T-G-G
Aug 05 2016 14:36
Also found in the vendor.bundle.js.map, its all the core-js modules but don't know what it would have es7 stuff loaded when i changed the .bablerc to have just es2015
Sergey Protko
@fesor
Aug 05 2016 14:37
@T-G-G all this shim stuff is added in gulpfile.babel.js
you could turn it off and only use polyfils that you need
T-G-G
@T-G-G
Aug 05 2016 14:40
Again prob quiet noobish but how would I do that all i can see in the gulpfile.babel.js is 'babel-polyfill' relating to babel in anyway, how would I make it so that it only loads those that are required or even only the es6 stuff at least?
Sergey Protko
@fesor
Aug 05 2016 14:40

is 'babel-polyfill' relating to babel in anyway

this is ALL polyfils, you can import only that you need

T-G-G
@T-G-G
Aug 05 2016 14:52
@fesor Cheers!!! playing with the different pre-set's now don't suppose anyone knows a lightweight es2015 as the babel-preset-es2015 is actually bigger weirdly
Sergey Protko
@fesor
Aug 05 2016 14:53
@T-G-G AngularClass/NG6-starter#143
T-G-G
@T-G-G
Aug 05 2016 14:56
@fesor You sir are a legend!!