-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
60 lines (58 loc) · 1.75 KB
/
vue.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
56
57
58
59
60
/* eslint-disable global-require */
const path = require('path');
const TransformPages = require('uni-read-pages');
const { webpack } = new TransformPages();
module.exports = {
transpileDependencies: ['uview-ui', '@dcloudio/uni-ui'],
pluginOptions: {},
productionSourceMap: false,
css: {
loaderOptions: {
postcss: {
parser: require('postcss-comment'),
plugins: [
require('autoprefixer')({
overrideBrowserslist: ['last 15 versions']
}),
require('postcss-import')({
resolve(id) {
if (id.startsWith('~@/')) {
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3));
}
if (id.startsWith('@/')) {
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2));
}
if (id.startsWith('/') && !id.startsWith('//')) {
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1));
}
return id;
}
}),
require('@dcloudio/vue-cli-plugin-uni/packages/postcss'),
require('postcss-nested'),
require('postcss-windicss-postcss7'),
require('@dcloudio/vue-cli-plugin-uni/packages/postcss')
]
},
sass: {}
}
},
configureWebpack: {
plugins: [
new webpack.DefinePlugin({
ROUTES: webpack.DefinePlugin.runtimeValue(() => {
const tfPages = new TransformPages({
includes: ['path', 'name', 'meta', 'aliasPath']
});
return JSON.stringify(tfPages.routes);
}, true)
})
]
},
devServer: {
port: 8100, // 本地调试的端口
open: true,
public: 'http://192.168.100.87:8100',
host: '0.0.0.0'
}
};