-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
poi.config.js
50 lines (44 loc) · 1.19 KB
/
poi.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
/*
* @Author: 卓文理
* @Email: [email protected]
* @Date: 2017-08-22 15:05:24
*/
'use strict';
const path = require('path');
module.exports = (options, req) => ({
entry: 'src/index.js',
host: '0.0.0.0',
filename: {
js: '[name].js',
css: '[name].css',
static: 'static/[name]-[hash].[ext]'
},
html: {
title: 'New Tabs',
template: 'index.html'
},
resolve: true,
sourceMap: !!options.dev,
extendWebpack(cfg) {
// Disable progress bar while building
// cfg.plugins.delete('progress-bar');
cfg.module.rule('scss')
.use('sass-loader')
.tap(opt => {
opt.includePaths = [path.resolve(__dirname, './node_modules')];
return opt;
});
},
webpack(cfg) {
cfg.resolve.modules.push(path.resolve('src'));
cfg.resolve.alias.vue$ = 'vue/dist/vue.js';
if (!options.dev) {
cfg.devtool = false;
cfg.bail = true;
} else {
cfg.devtool = 'source-map';
}
return cfg;
},
vendor: options.mode === 'test' ? false : Object.keys(require('./package.json').dependencies)
});