forked from jussikinnula/angular-socket-io-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.js
60 lines (54 loc) · 1.75 KB
/
webpack.dev.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');
const config = require('./webpack.client');
// plugins
const CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
const DedupePlugin = webpack.optimize.DedupePlugin;
const DefinePlugin = webpack.DefinePlugin;
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const OccurenceOrderPlugin = webpack.optimize.OccurenceOrderPlugin;
const LiveReloadPlugin = require('webpack-livereload-plugin');
module.exports = {
target: 'web',
cache: true,
debug: true,
devtool: 'source-map',
resolve: config.resolve,
module: config.module,
stats: config.stats,
postcss: config.postcss,
sassLoader: config.sassLoader,
entry: {
'assets/js/client': config.entry['assets/js/client'],
'assets/js/vendor': config.entry['assets/js/vendor'],
'assets/js/polyfills': config.entry['assets/js/polyfills']
},
plugins: [
new DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
}),
new ExtractTextPlugin('assets/css/styles.css'),
new DedupePlugin(),
new OccurenceOrderPlugin(),
new CommonsChunkPlugin({
name: [
'assets/js/client',
'assets/js/vendor',
'assets/js/polyfills'
]
}),
new HtmlWebpackPlugin({
chunksSortMode: 'none',
filename: 'index.html',
hash: true,
inject: 'body',
template: './src/index.html'
}),
new LiveReloadPlugin({
appendScriptTag: true
})
],
output: config.output
};