-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(legacy): fix conflict with the modern build on css emitting (#6584)
Fixes #3296 Supersedes #3317 The asset emitting conflict may also exist for other types of assets, but let's fix the CSS one first. The conflict here is due to the `hasEmitted` flag that was originally intended to avoid duplicated CSS for multiple output formats 6bce108#diff-2cfbd4f4d8c32727cd8e1a561cffbde0b384a3ce0789340440e144f9d64c10f6R262-R263 When the legacy plugin is used, the flag was set to `true` for the emitted CSS of the legacy bundle. But the legacy plugin would remove all its emitted assets later to avoid duplication. So this logic results in no CSS to be actually emitted. In this PR, I used a `__vite_skip_asset_emit__` flag to prevent the CSS `generateBundle` from executing for the legacy build. If other asset emitting plugins encounter similar issues, this flag can be reused.
- Loading branch information
1 parent
8338e26
commit f48255e
Showing
6 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import './style.css' | ||
|
||
async function run() { | ||
const { fn } = await import('./async.js') | ||
fn() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#app { | ||
color: red; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ module.exports = { | |
], | ||
|
||
build: { | ||
cssCodeSplit: false, | ||
manifest: true, | ||
rollupOptions: { | ||
output: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters