Skip to content

Commit

Permalink
fix: replace server.origin in css plugin (fix #5408) (#5571)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbohn authored Nov 7, 2021
1 parent 2efc1e5 commit bd8b66d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/playground/tailwind/vite.config.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit bd8b66d

Please sign in to comment.