-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
51 lines (48 loc) · 1.2 KB
/
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
42
43
44
45
46
47
48
49
50
51
// https://vitejs.dev/config/
import { fileURLToPath, URL } from 'node:url'
import { env } from 'node:process';
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'node:path';
// Please set the appropriate namespace and modulename.
// If deploying locally then set the appropriate hostname.
const _MODULES_CDN_BASE_URL = 'http://modules-my.fluidspace.local/namespace/modulename';
export default defineConfig({
define: {
'process.env': env
},
plugins: [vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('module-')
}
}
})],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
build: {
cssCodeSplit: false,
copyPublicDir: false,
chunkSizeWarningLimit: 1000,
rollupOptions: {
output: {
entryFileNames: 'js/main-[hash].js',
format: 'iife',
exports: 'none',
generatedCode: 'es2015',
sourcemap: false
}
}
},
experimental: {
renderBuiltUrl(filename, { type }) {
if (type === 'asset') {
return _MODULES_CDN_BASE_URL + '/' + filename;
}
return filename;
}
}
});