forked from R0B0T-0NE/fs-ui-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
32 lines (29 loc) · 910 Bytes
/
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
import { defineConfig } from "vite";
import { resolve } from "path";
const files = ["colors/main.scss", "components/button/button.scss"];
const entries = files.map((file) => resolve(__dirname, `./src/styles/${file}`));
export default () => {
return defineConfig({
build: {
cssCodeSplit: true,
lib: {
entry: entries,
name: "FS UI Library",
formats: ['es', 'cjs']
},
rollupOptions: {
input: {
"fs-colors": "./src/styles/colors/main.scss",
"fs-colors-wc": "./src/styles/colors/main-wc.scss",
"fs-base-styles": "./src/styles/app-components/main.scss",
"fs-reset": "./src/styles/base/reset.scss",
},
output: {
entryFileNames: `assets/[name].js`,
chunkFileNames: `assets/[name].js`,
assetFileNames: `assets/styles/[name].[ext]`,
},
},
},
});
};