-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
41 lines (40 loc) · 925 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
33
34
35
36
37
38
39
40
41
import path from "path";
import { NodePackageImporter } from "sass";
import { fileURLToPath } from "url";
import { defineConfig } from "vite";
export default defineConfig({
build: {
lib: {
entry: {
iati: path.resolve(__dirname, "src/js/main.js"),
css: path.resolve(__dirname, "src/scss/main.scss"),
},
fileName: "iati",
formats: ["es"],
},
rollupOptions: {
output: {
entryFileNames: "js/[name].js",
assetFileNames: (assetInfo) => {
if (assetInfo.name == "style.css") {
return `css/iati.css`;
}
return assetInfo.name;
},
},
},
cssMinify: false,
},
css: {
preprocessorOptions: {
scss: {
pkgImporter: new NodePackageImporter(),
},
},
},
resolve: {
alias: {
"@assets": fileURLToPath(new URL("./src/assets", import.meta.url)),
},
},
});