-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathparent-vite.config.js
More file actions
28 lines (26 loc) · 898 Bytes
/
parent-vite.config.js
File metadata and controls
28 lines (26 loc) · 898 Bytes
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
/**
* We do a second build for parent (the first one builds both parent and chatterbox-app) because we need
* the link to the CSS file for parent with the asset-hash included.
*/
const { defineConfig } = require("vite")
const { resolve } = require("path");
// We've configured the first build to produce a manifest.json that tells us what the asset-hashed file names are.
import manifestJSON from "./target/manifest.json";
const cssLink = manifestJSON["index.html"]["css"][0];
module.exports = defineConfig({
build: {
rollupOptions: {
input: {
parent: resolve(__dirname, "index.html"),
},
output: {
entryFileNames: "assets/[name].js",
},
},
outDir: "./target/parent",
assetsInlineLimit: 0,
},
define: {
CSS_FILE_NAME: cssLink.replace(/assets\//, ""),
}
});