Upgrade webpack example in documentation to webpack v2
See: - https://webpack.js.org/guides/migrating - http://javascriptplayground.com/blog/2016/10/moving-to-webpack-2/ - https://github.com/webpack/webpack/issues/3043
This commit is contained in:
parent
63551fca17
commit
5f10829b6d
|
@ -107,25 +107,28 @@ module.exports = {
|
||||||
},
|
},
|
||||||
devtool: '#cheap-module-source-map',
|
devtool: '#cheap-module-source-map',
|
||||||
resolve: {
|
resolve: {
|
||||||
modulesDirectories: ['node_modules'],
|
modules: ['node_modules'],
|
||||||
extensions: ['', '.js']
|
extensions: ['.js']
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
rules: [
|
||||||
{ test: /\.js$/, exclude: /node_modules/,
|
{ test: /\.js$/, exclude: /node_modules/,
|
||||||
loader: 'babel-loader' },
|
loader: 'babel-loader' },
|
||||||
{ test: /\.scss$/,
|
{ test: /\.scss$/,
|
||||||
loader: ExtractTextPlugin.extract(
|
loader: ExtractTextPlugin.extract({
|
||||||
'style-loader', 'css-loader!sass-loader') },
|
fallback: 'style-loader',
|
||||||
|
use: 'css-loader!sass-loader' } ) },
|
||||||
{ test: /\.css$/,
|
{ test: /\.css$/,
|
||||||
loader: ExtractTextPlugin.extract(
|
loader: ExtractTextPlugin.extract({
|
||||||
'style-loader', 'css-loader') },
|
fallback: 'style-loader',
|
||||||
|
use: 'css-loader' } ) },
|
||||||
{ test: /\.(woff2?|ttf|eot|svg|png|jpe?g|gif)$/,
|
{ test: /\.(woff2?|ttf|eot|svg|png|jpe?g|gif)$/,
|
||||||
loader: 'file' }
|
loader: 'file' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new ExtractTextPlugin('styles.css', {
|
new ExtractTextPlugin({
|
||||||
|
filename: 'styles.css',
|
||||||
allChunks: true
|
allChunks: true
|
||||||
}),
|
}),
|
||||||
new webpack.optimize.UglifyJsPlugin()
|
new webpack.optimize.UglifyJsPlugin()
|
||||||
|
|
Loading…
Reference in New Issue