-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.babel.js
More file actions
63 lines (62 loc) · 1.52 KB
/
webpack.config.babel.js
File metadata and controls
63 lines (62 loc) · 1.52 KB
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
61
62
63
import { resolve } from 'path'
import webpack from 'webpack'
import HtmlWebpackPlugin from 'html-webpack-plugin'
// TODO: Correct dist build.
export default {
entry: {
app: [
'webpack-hot-middleware/client',
resolve(__dirname, 'client/main.js')
]
},
output: {
path: resolve(__dirname, 'client_dist'),
filename: '[name].[hash].js',
publicPath: '/'
},
devServer: {
stats: true,
publicPath: '/'
},
module: {
rules: [
{
test: /.js$/,
use: 'babel-loader'
},
{
test: /.vue$/,
use: 'vue-loader'
}
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function(module) {
return module.context && module.context.indexOf('node_modules') !== -1
}
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest'
}),
new webpack.HotModuleReplacementPlugin(),
// new webpack.NoEmitOnErrorsPlugin(), // TODO: Trigger only on dist build.
new HtmlWebpackPlugin({
template: resolve(__dirname, 'client/index.html'),
minify: { // TODO: Trigger only on dist build.
collapseWhitespace: true
}
})
],
resolve: {
extensions: ['.js', '.vue', '.css', '.scss'],
alias: {
src: resolve(__dirname, 'client'),
components: resolve(__dirname, 'client/components'),
scss: resolve(__dirname, 'client/scss'),
store: resolve(__dirname, 'client/store'),
router: resolve(__dirname, 'client/router'),
}
}
}