-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.config.js
38 lines (33 loc) · 1.05 KB
/
webpack.dev.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const config = require('./webpack.config');
const sassConfig = {
includePaths: ['node_modules/bootstrap-sass/assets/stylesheets'],
};
delete config.output.publicPath;
delete config.devServer;
// delete config.devtool;
config.devtool = 'inline-source-map';
config.module.rules[1] = {
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', `sass-loader?${JSON.stringify(sassConfig)}`],
}),
};
config.output.filename = '[name].[chunkhash].js';
//config.plugins.push(new webpack.optimize.UglifyJsPlugin());
config.plugins.push(
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
})
);
config.plugins.push(new ExtractTextPlugin('style.css'));
config.plugins.push(new CleanWebpackPlugin(['dist/']));
config.plugins.push(
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
})
);
module.exports = config;