forked from joeldenning/vite-single-spa-example
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
53 lines (51 loc) · 1.27 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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import dynamicImport from 'vite-plugin-dynamic-import'
const path = require("path");
const { parsed } = require("dotenv").config({
path: path.resolve(__dirname, "./src/.env"),
});
export default defineConfig(({ mode }) => {
const publicAssetsBaseUrl =
mode === "production"
? parsed.VITE_MF_VUE_PROD_DOMAIN + "/"
: "http://localhost:3001/";
return {
root: "./src",
base: publicAssetsBaseUrl,
rollupOptions: {
input: "vite-single-spa-vue.ts",
format: "system",
preserveEntrySignatures: true,
},
build: {
outDir: "../dist",
emptyOutDir: true,
cssCodeSplit: false,
manifest: true,
rollupOptions: {
input: "./src/vite-single-spa-vue.ts",
preserveEntrySignatures: true,
output: {
entryFileNames: "[name].js",
assetFileNames: "assets/[name].[ext]",
},
},
},
resolve: {
fullySpecified: false,
modules: ["node_modules"],
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json'],
},
plugins: [
vue({
template: {
transformAssetUrls: {
base: '/src'
}
}
}),
dynamicImport(),
],
};
});