-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
64 lines (62 loc) · 1.31 KB
/
vite.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
61
62
63
64
import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'
import Markdown from 'vite-plugin-vue-markdown'
import { resolve } from "path";
import postcssPresetEnv from "postcss-preset-env"
import postcssPxtorem from "postcss-pxtorem"
import jsdom from "jsdom"
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
"@": resolve(__dirname, "src"),
},
},
plugins: [
Vue({
include: [/\.vue$/, /\.md$/],
}),
Markdown()
],
test: {
environment: 'jsdom',
},
build: {
lib: {
entry: "./packages/index.js",
name: "ysz-ui",
fileName: format => `ysz-ui-${format}.js`
},
rollupOptions: {
// 排除不要的依赖
external: ["vue",
"vue3-perfect-scrollbar",
"highlight.js",
"@vitejs/plugin-vue",
"sass-loader",
"@vitejs/plugin-vue",
"vite-plugin-vue-markdown",
"@highlightjs/vue-plugin"
],
output: {
globals: {
vue: "Vue"
}
}
}
},
css: {
preprocessorOptions: {
scss: {
additionalData: '@use "./src/style/index.scss" as *;'
}
},
postcss: {
// 一些配置
plugins: [postcssPresetEnv(),postcssPxtorem({
rootValue: 16,
propList: ['*']
})]
}
}
})