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: replace server.origin in css plugin (fix #5408) #5571

Merged
merged 2 commits into from Nov 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/playground/tailwind/vite.config.ts
Expand Up @@ -11,5 +11,10 @@ export default defineConfig({
build: {
// to make tests faster
minify: false
},
server: {
// This option caused issues with HMR,
// although it should not affect the build
origin: "http://localhost:8080/",
}
})
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/css.ts
Expand Up @@ -218,7 +218,7 @@ export function cssPlugin(config: ResolvedConfig): Plugin {
: await moduleGraph.ensureEntryFromUrl(
(
await fileToUrl(file, config, this)
).replace(config.base, '/')
).replace((config.server?.origin ?? '') + config.base, '/')
)
)
}
Expand Down