Webpack 2, RC 7(github.com) |
Webpack 2, RC 7(github.com) |
'css-loader?modules-true!postcss-loader!sass-loader'
Loaders are configured with an ordered list: [
{
loader: 'css-loader',
options: {
modules: true
}
},
{
loader: 'postcss-loader'
},
{
loader: 'sass-loader'
}
]
It takes up way more space but it's also entirely clear what's happening.More config changes are summarized here:
http://javascriptplayground.com/blog/2016/10/moving-to-webpa...
I was hitting my head against my desk setting up npm and webpack 1 for almost 3 hours a couple of weeks ago. I then said fuck it, replaced them with yarn and webpack 2 respectively and all my issues were fixed.
Truly magical.
Figuring how to configure webpack 1 (haven't tried 2) is crazy, and I don't understand how people able to construct such a complex tool that is currently unique on the market, and works so well, managed to design a conf settings that badly.
before you had to use systemjs and jspm or something.
I wonder if the performance has improved.
I think it came from RequireJS, probably intended for one-off usage (e.g. a single require that requires a certain loader)
Still a bad idea, though.
http://requirejs.org/docs/plugins.html (Jan 2011: https://web.archive.org/web/20110109084245/http://requirejs....)
If I responsibly say `import { map } from 'lodash'`;, but (say) my frontend rendering library says `import _ from 'lodash'; _.map(things, func);`, then unfortunately, transitively, I'll still get all of lodash.