-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
37 lines (33 loc) · 918 Bytes
/
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
const path = require("path");
const { defineConfig } = require("@vue/cli-service");
const { VantResolver } = require("@vant/auto-import-resolver");
const ComponentsPlugin = require("unplugin-vue-components/webpack");
module.exports = defineConfig({
transpileDependencies: true,
css: {
loaderOptions: {
postcss: {
postcssOptions: {
plugins: [
require("postcss-plugin-px2rem")({
rootValue: 37.5,
exclude: /node_module/,
}),
],
},
},
},
},
pluginOptions: {
// 自动引入 scss 变量
"style-resources-loader": {
preProcessor: "scss",
patterns: [path.resolve(__dirname, "src/assets/var.scss")],
},
},
configureWebpack: {
plugins: [
ComponentsPlugin.default({ resolvers: [VantResolver()] }), //当 unplugin-vue-components 版本大于等于 0.26.0
],
},
});