webpack.config.js
928 Bytes
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 webpack = require('webpack');
module.exports = {
devtool: 'source-map',
debug: true,
entry: {
'cms': './cms.js'
},
output: {
path: 'public/build',
publicPath: 'build/',
filename: '[name].js'
},
resolve: {
// 配置第三方插件别名
alias: {
'ajax':__dirname+'/public/js/ajax.js',
'jquery': __dirname + '/public/js/jquery.js',
'underscore': __dirname + '/public/js/underscore.js'
}
},
plugins: [
// 配置全局依赖,无需再次require
new webpack.ProvidePlugin({
jQuery: "jquery",
$: "jquery",
_: 'underscore',
Ajax:'ajax'
})
],
module: {
loaders: [
{
test: /\.vue$/,
loader: 'vue'
},
{
test: /\.css$/,
loader: 'style!css'
}
],
devServer: {
historyApiFallback: true,
hot: true,
inline: true,
progress: true
}
}
};