-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
81 lines (80 loc) · 2.34 KB
/
vite.config.ts
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { defineConfig } from "vite";
import path from "path";
import vue from "@vitejs/plugin-vue";
import vueJsx from '@vitejs/plugin-vue-jsx';
import postcssPxtorem from "postcss-pxtorem";
export default defineConfig({
plugins: [
vue(),
vueJsx({
babelPlugins: [
[
"@babel/plugin-proposal-decorators",
{
legacy: true
}
]
]
})
],
css: {
preprocessorOptions: {
less: {
additionalData: `@import "@/styles/control.module.less";`
}
},
postcss: {
plugins: [
postcssPxtorem({
rootValue: 40,
propList: ["*"],
minPixelValue: 2,
exclude: /src/
})
]
}
},
build: {
outDir: path.resolve(__dirname, "./lib"),
lib: {
entry: path.resolve(__dirname, "src/main.ts"),
name: "Loni",
fileName: "loni"
},
rollupOptions: {
external: ["vue"],
output: [
{
format: 'umd',
exports: 'named',
sourcemap: false,
entryFileNames: 'loni.cjs',
chunkFileNames: '[name].js',
assetFileNames: '[name].[ext]',
inlineDynamicImports: false,
manualChunks: undefined,
globals: { vue: 'Vue' }
},
{
format: 'es',
exports: 'named',
sourcemap: false,
entryFileNames: 'loni.mjs',
chunkFileNames: '[name].js',
assetFileNames: '[name].[ext]',
inlineDynamicImports: false,
manualChunks: undefined,
globals: { vue: 'Vue' }
}
]
}
},
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
"#": path.resolve(__dirname, "tests"),
"components": path.resolve(__dirname, "src/components"),
"styles": path.resolve(__dirname, "src/styles")
}
}
});