Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): avoid bundling injectionKeys in custom components #718

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/ui/vite.config.custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { defineConfig, UserConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import writerPlugin from "./viteWriterPlugin";

const injectionKeys = path.resolve("src/injectionKeys");

export default defineConfig({
base: "./",
plugins: [vue(), writerPlugin()],
Expand All @@ -29,11 +31,11 @@ export default defineConfig({
},
},
rollupOptions: {
external: ["vue", "../injectionKeys"],
external: ["vue", injectionKeys],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to use this code to make the build of custom component working on windows.

rollupOptions: {
			external: ["vue", "@/injectionKeys"],
			output: {
				globals: {
					vue: "vue",
					[path.resolve("src/injectionKeys")]: "injectionKeys",
				},
			},
		},
		```

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented it in d6fb5ec

output: {
globals: {
vue: "vue",
[path.resolve("src/injectionKeys")]: "injectionKeys",
[injectionKeys]: "injectionKeys",
},
},
},
Expand Down
Loading