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