-
Notifications
You must be signed in to change notification settings - Fork 31
/
webpack.config.base.js
44 lines (39 loc) · 1.08 KB
/
webpack.config.base.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
var path = require('path');
var webpack = require('webpack');
var entryPath = path.join(__dirname, 'src');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: {
app: path.join(entryPath, 'app.js'),
vendor: ['vue', 'vuex', 'vue-router']
},
module: {
loaders: [{
test: /\.vue$/,
exclude: /node_modules/,
loader: 'vue-loader'
}, {
test: /\.js$/,
exclude: /node_modules|vue\/dist/,
loader: 'babel'
}, {
test: /\.(less|css)?$/,
loader: ExtractTextPlugin.extract(['css', 'less'])
}, {
test: /\.(png|jpg)$/,
loader: 'url?limit=25000'
}, {
test: /\.(svg|ttf|eot|svg|woff(\(?2\)?)?)(\?[a-zA-Z_0-9.=&]*)?(#[a-zA-Z_0-9.=&]*)?$/,
loader: "file-loader"
}]
},
resolve: {
extensions: ['', '.js', '.vue', '.css', '.less'],
alias: {
'vue$': 'vue/dist/vue.js'
}
},
plugins: [
new webpack.NoErrorsPlugin()
]
}