-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Proxy css as js through alias #18193
Labels
Comments
export default defineConfig({
resolve: {
alias: {
"testpkg/b.css": "testpkg/proxy_b_css.js"
}
},
optimizeDeps: {
include: [
"testpkg/proxy_b_css.js"
]
},
plugins: [vue()],
}) |
Proxy is dynamically created during the build process, so I cannot include it in the include file
…---- Replied Message ----
| From | ***@***.***> |
| Date | 09/25/2024 09:29 |
| To | vitejs/vite ***@***.***> |
| Cc | zhn ***@***.***>,
Author ***@***.***> |
| Subject | Re: [vitejs/vite] Proxy css as js through alias (Issue #18193) |
optimizeDeps.include needs to be used instead of optimizeDeps.needsInterop.
exportdefaultdefineConfig({resolve: {alias: {"testpkg/b.css": "testpkg/proxy_b_css.js"}},optimizeDeps: {include: ["testpkg/proxy_b_css.js"]},plugins: [vue()],})
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I encountered this issue as the Modulu-federation requires sharing CSS used in multiple projects
…---- Replied Message ----
| From | ***@***.***> |
| Date | 09/25/2024 09:29 |
| To | vitejs/vite ***@***.***> |
| Cc | zhn ***@***.***>,
Author ***@***.***> |
| Subject | Re: [vitejs/vite] Proxy css as js through alias (Issue #18193) |
optimizeDeps.include needs to be used instead of optimizeDeps.needsInterop.
exportdefaultdefineConfig({resolve: {alias: {"testpkg/b.css": "testpkg/proxy_b_css.js"}},optimizeDeps: {include: ["testpkg/proxy_b_css.js"]},plugins: [vue()],})
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
What do you mean by "dynamically created during the build process"? I guess I need a more complete reproduction. |
I will provide a more comprehensive demo later
…---- Replied Message ----
| From | ***@***.***> |
| Date | 09/25/2024 09:45 |
| To | vitejs/vite ***@***.***> |
| Cc | zhn ***@***.***>,
Author ***@***.***> |
| Subject | Re: [vitejs/vite] Proxy css as js through alias (Issue #18193) |
What do you mean by "dynamically created during the build process"?
I guess I need a more complete reproduction.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Hello @zhangHongEn. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
ReferenceError: require is not defined
Reproduction
https://github.com/zhangHongEn/vite-wrap-css
Steps to reproduce
pnpm install && pnpm run dev
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: