Skip to content

Commit

Permalink
Merge pull request #228 from FabienArcellier/20-custom-components-bui…
Browse files Browse the repository at this point in the history
…ld-properly-on-windows

fix: custom components build properly on windows
  • Loading branch information
ramedina86 authored Feb 21, 2024
2 parents 3b3b5c3 + 2d9e23c commit 0db0d6f
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions ui/vite.config.custom.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import { fileURLToPath, URL } from "url";
import path from "path";

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import monacoEditorPlugin from "vite-plugin-monaco-editor";

/*
injectionKeys is externalised so that it can be linked at runtime.
Otherwise, new, independent instances of Symbol would be created, for which
nothing would be provided.
*/
const injectionKeysPath = fileURLToPath(
new URL("src/injectionKeys.ts", import.meta.url),
);

export default defineConfig({
base: "./",
plugins: [vue(), { ...monacoEditorPlugin({}), apply: "serve" }],
Expand All @@ -28,11 +19,11 @@ export default defineConfig({
fileName: "templates",
},
rollupOptions: {
external: ["vue", injectionKeysPath],
external: ["vue", "../injectionKeys"],
output: {
globals: {
vue: "vue",
[injectionKeysPath]: "injectionKeys",
[path.resolve("src/injectionKeys")]: "injectionKeys",
},
},
},
Expand All @@ -41,7 +32,7 @@ export default defineConfig({
},
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
"@": path.resolve("src"),
},
},
server: {
Expand Down

0 comments on commit 0db0d6f

Please sign in to comment.