-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcooking.conf.js
63 lines (59 loc) · 1.4 KB
/
cooking.conf.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
56
57
58
59
60
61
62
63
var path = require('path');
var cooking = require('cooking');
cooking.set({
entry: {
app: './src/index.js',
vendor: ['vue', 'vue-router', 'vue-resource']
},
dist: './dist',
template: './src/index.html',
devServer: {
port: 8081,
publicPath: '/',
log: false
},
// production
clean: true,
hash: true,
sourceMap: true,
minimize: true,
chunk: true, // see https://cookingjs.github.io/zh-cn/configuration.html#chunk
postcss: [
require('postcss-import')({
addDependencyTo: require('webpack')
}),
require('postcss-px2rem'),
require('postcss-nested'),
require('postcss-cssnext')({
browsers: ['last 2 versions', 'iOS >= 7', 'Android >= 4.0']
})
],
publicPath: '/dist/',
assetsPath: 'static',
urlLoaderLimit: 10000,
extractCSS: '[name].[contenthash:7].css',
alias: {
src: path.join(__dirname, 'src'),
vue: 'vue/dist/vue.js'
},
extends: ['vue2', 'lint', 'sass']
});
cooking.add('loaders.svg', [
{
test: /\.svg$/,
exclude: [/not-sprite-svg/],
loaders: ['svg-sprite-loader']
}, {
test: /\.svg$/,
include: [/not-sprite-svg/],
loaders: ['url-loader']
}
]);
cooking.add('preLoaders.svg', {
test: /\.svg$/,
loaders: ['svgo-loader?' + JSON.stringify(require('./src/common/util/svgo-config'))]
});
cooking.add('resolve.root', [
path.join(__dirname, 'src/assets/')
]);
module.exports = cooking.resolve();