-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.mts
42 lines (41 loc) · 994 Bytes
/
vite.config.mts
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
import { defineConfig } from "vite";
import { resolve } from "path";
import vue from "@vitejs/plugin-vue";
export default defineConfig({
plugins: [vue()],
css: {
preprocessorOptions: {
scss: {
// componentのscssで共通でimportするstyleの指定
additionalData: `@import "@/stylesheets";`
}
}
},
resolve: {
alias: {
'@': resolve(__dirname, 'src')
}
},
build: {
// library mode でビルド
lib: {
entry: resolve(__dirname, "src/main.ts"),
name: "lapras-frontend",
fileName: "lapras-frontend",
formats: ['es', 'umd', 'cjs']
},
rollupOptions: {
external: ["vue"],
output: {
globals: {
vue: "Vue",
},
assetFileNames: (assetInfo) => {
// vue-cliでのbuild時の命名に合わせる
if (assetInfo.name === 'style.css') return 'lapras-frontend.css';
return assetInfo.name ?? '';
}
},
},
},
});