-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.dev.config.js
49 lines (44 loc) · 1.1 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
39
40
41
42
43
44
45
46
47
48
49
/**
* 开发环境
*/
var path = require('path');
var fs = require('fs')
var webpack = require('webpack');
var merge = require('webpack-merge');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var webpackBaseConfig = require('./webpack.base.config.js');
var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
process.env.NODE_ENV = '"development"';
module.exports = merge(webpackBaseConfig, {
entry: {
main: './src/main',
vendors: ['vue', 'vue-router']
},
output: {
path:path.join(__dirname, './example'),
publicPath: '',
filename: 'js/[name].js',
chunkFilename: 'chunk/[name].chunk.js'
},
resolve: {
alias: {
vue: 'vue/dist/vue.js'
},
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': process.env.NODE_ENV,
'globalConfigs':require('./index')
}),
new webpack.optimize.CommonsChunkPlugin({ name: 'vendors', filename: 'js/vendor.bundle.js' }),
new HtmlWebpackPlugin({
inject: false,
filename: './index.html',
template: './src/template/index.ejs'
}),
new FriendlyErrorsPlugin()
],
devServer: {
disableHostCheck: true
}
});