-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
68 lines (66 loc) · 2.31 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
import { defineConfig } from "vite";
import { resolve } from "path";
import vue from "@vitejs/plugin-vue";
import banner from "vite-plugin-banner";
import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite";
const COPYRIGHT_BANNER =
"/*!\n" +
"* Copyright 2022, 2023 Utrecht University\n" +
"*\n" +
"* Licensed under the EUPL, Version 1.2 only\n" +
"* You may not use this work except in compliance with the\n" +
"Licence.\n" +
"* A copy of the Licence is provided in the 'LICENCE' file in this project.\n" +
"* You may also obtain a copy of the Licence at:\n" +
"*\n" +
"* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n" +
"*\n" +
"* Unless required by applicable law or agreed to in\n" +
"writing, software distributed under the Licence is\n" +
'distributed on an "AS IS" basis,\n' +
"* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n" +
"express or implied.\n" +
"* See the Licence for the specific language governing\n" +
"permissions and limitations under the Licence.\n" +
"*/";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), banner(COPYRIGHT_BANNER), VueI18nPlugin({})],
resolve: {
alias: {
"@": resolve(__dirname, "./src"),
},
},
build: {
cssCodeSplit: false,
minify: "esbuild",
lib: {
entry: {
"cdh-vue-lib": resolve(__dirname, "src/cdh-vue-lib/index.ts"),
components: resolve(__dirname, "src/cdh-vue-lib/components.ts"),
composables: resolve(
__dirname,
"src/cdh-vue-lib/composables.ts",
),
},
formats: ["es"],
name: "CDHVueLib",
// the name of the output files when the build is run
fileName: (format, entryName) => {
if (entryName == "cdh-vue-lib") {
return `cdh-vue-lib.${format}.js`;
}
return `cdh-vue-lib.${entryName}.${format}.js`;
},
},
rollupOptions: {
external: ["vue", "uuid", "vue-i18n"],
output: {
globals: {
vue: "Vue",
uuid: "uuid",
},
},
},
},
});