-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvue.config.js
49 lines (49 loc) · 1.39 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
/*
* @Author: Just be free
* @Date: 2020-05-06 14:45:16
* @Last Modified by: Just be free
* @Last Modified time: 2020-07-24 15:02:35
* @E-mail: [email protected]
*/
process.env.VUE_APP_VERSION = require('./package.json').version;
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const publicPath = process.env.NODE_ENV === 'production' ? "/youdefine-UI/" : "/";
module.exports = {
publicPath,
outputDir: "docs",
configureWebpack: {
devtool: "source-map",
plugins: [
new MiniCssExtractPlugin({
filename: `css/[name].css`
})
],
performance: {
hints: false
}
},
css: {
extract: false
},
chainWebpack: config => {
const svgRule = config.module.rule('svg');
// 清除已有的所有 loader。
// 如果你不这样做,接下来的 loader 会附加在该规则现有的 loader 之后。
// https://cli.vuejs.org/zh/guide/webpack.html#%E6%B7%BB%E5%8A%A0%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84-loader
svgRule.uses.clear();
config.module
.rule('images')
.test(/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/)
.use('url-loader')
.loader('url-loader')
.tap(options => Object.assign(options, { limit: 10240 }))
},
pages: {
index: {
entry: "examples/main.js",
template: "examples/example.html",
filename: "index.html",
title: "Examples for YUI components"
}
}
};