-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
55 lines (51 loc) · 1.19 KB
/
webpack.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
50
51
52
53
54
55
/**
* =================================
* @2018 塞伯坦-CYB前端模块化工程构建工具
* https://github.com/jd-cyb/cyb-cli
* =================================
*/
const eslintFriendlyFormatter = require('eslint-friendly-formatter')
const config = require('./cyb.config.js')
const eslintLoader = () => ({
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
exclude: /(node_modules|bower_components)/,
options: {
formatter: eslintFriendlyFormatter,
emitWarning: true
}
})
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = {
resolve: {
extensions: ['.js', '.json', '.vue'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': 'views/index',
'_c': 'views/index/components',
'_conf': 'views/config'
}
},
module: {
rules: [
...(config.eslint.available ? [eslintLoader()] : []),
{
test: /\.vue$/,
loader: 'vue-loader'
}, {
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
babelrc: true
}
}
}
]
},
plugins: [
new VueLoaderPlugin()
]
}