-
-
Notifications
You must be signed in to change notification settings - Fork 734
fix: should not inject css prefetch/preload runtime when only prefetch/preload js chunks #12112
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ec9ae18
fix: should not inject css prefetch/preload runtime when only prefetc…
LingyuCoder e0f159c
fix: should not inject css prefetch/preload runtime when only prefetc…
LingyuCoder f07209c
fix: should not inject css prefetch/preload runtime when only prefetc…
LingyuCoder 0128442
fix: should not inject css prefetch/preload runtime when only prefetc…
LingyuCoder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
2 changes: 1 addition & 1 deletion
2
tests/rspack-test/configCases/asset-modules/errored/test.filter.js
This file contains hidden or 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 +1 @@ | ||
| module.exports = () => "FIXME: can not find the css folder" | ||
| module.exports = () => "TODO: generate empty css asset when loader throws error" |
This file contains hidden or 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 hidden or 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,10 +1,11 @@ | ||
| "use strict"; | ||
|
|
||
| module.exports = { | ||
| moduleScope(scope) { | ||
| moduleScope(scope, stats) { | ||
| const __STATS_I__ = stats().__index__; | ||
| const link = scope.window.document.createElement("link"); | ||
| link.rel = "stylesheet"; | ||
| link.href = `bundle${scope.__STATS_I__}.css`; | ||
| link.href = `bundle${__STATS_I__}.css`; | ||
| scope.window.document.head.appendChild(link); | ||
| } | ||
| }; |
This file contains hidden or 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 +1 @@ | ||
| module.exports = () => "FIXME: can not resolve errors"; | ||
| module.exports = () => "TODO: support css/global"; |
This file contains hidden or 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 hidden or 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
1 change: 0 additions & 1 deletion
1
tests/rspack-test/configCases/web/prefetch-preload-module-only-js/test.filter.js
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
12 changes: 12 additions & 0 deletions
12
tests/rspack-test/hotCases/loader-import-module/css/__snapshots__/web/0.snap.txt
This file contains hidden or 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,12 @@ | ||
| # Case css: Step 0 | ||
|
|
||
| ## Changed Files | ||
|
|
||
|
|
||
| ## Asset Files | ||
| - Bundle: bundle.js | ||
|
|
||
| ## Manifest | ||
|
|
||
|
|
||
| ## Update |
53 changes: 53 additions & 0 deletions
53
tests/rspack-test/hotCases/loader-import-module/css/__snapshots__/web/1.snap.txt
This file contains hidden or 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,53 @@ | ||
| # Case css: Step 1 | ||
|
|
||
| ## Changed Files | ||
| - colors.js | ||
| - stylesheet.css.js | ||
|
|
||
| ## Asset Files | ||
| - Bundle: bundle.js | ||
| - Manifest: main.LAST_HASH.hot-update.json, size: 28 | ||
| - Update: main.LAST_HASH.hot-update.js, size: 436 | ||
|
|
||
| ## Manifest | ||
|
|
||
| ### main.LAST_HASH.hot-update.json | ||
|
|
||
| ```json | ||
| {"c":["main"],"r":[],"m":[]} | ||
| ``` | ||
|
|
||
|
|
||
| ## Update | ||
|
|
||
|
|
||
| ### main.LAST_HASH.hot-update.js | ||
|
|
||
| #### Changed Modules | ||
| - ./stylesheet.css.js | ||
|
|
||
| #### Changed Runtime Modules | ||
| - webpack/runtime/get_full_hash | ||
|
|
||
| #### Changed Content | ||
| ```js | ||
| "use strict"; | ||
| self["webpackHotUpdate"]("main", { | ||
| "./stylesheet.css.js": | ||
| /*!***************************!*\ | ||
| !*** ./stylesheet.css.js ***! | ||
| \***************************/ | ||
| (function (module) { | ||
| module.exports = "body { background: url(\"https://test.cases/path/assets/file.png\"); color: #0f0; }"; | ||
|
|
||
| }), | ||
|
|
||
| },function(__webpack_require__) { | ||
| // webpack/runtime/get_full_hash | ||
| (() => { | ||
| __webpack_require__.h = () => ("CURRENT_HASH") | ||
| })(); | ||
|
|
||
| } | ||
| ); | ||
| ``` |
98 changes: 98 additions & 0 deletions
98
tests/rspack-test/hotCases/loader-import-module/css/__snapshots__/web/2.snap.txt
This file contains hidden or 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,98 @@ | ||
| # Case css: Step 2 | ||
|
|
||
| ## Changed Files | ||
| - colors.js | ||
| - stylesheet.css.js | ||
|
|
||
| ## Asset Files | ||
| - Bundle: bundle.js | ||
| - Manifest: main.LAST_HASH.hot-update.json, size: 28 | ||
| - Update: main.LAST_HASH.hot-update.js, size: 436 | ||
|
|
||
| ## Manifest | ||
|
|
||
| ### main.LAST_HASH.hot-update.json | ||
|
|
||
| ```json | ||
| {"c":["main"],"r":[],"m":[]} | ||
| ``` | ||
|
|
||
|
|
||
| ## Update | ||
|
|
||
|
|
||
| ### main.LAST_HASH.hot-update.js | ||
|
|
||
| #### Changed Modules | ||
| - ./stylesheet.css.js | ||
|
|
||
| #### Changed Runtime Modules | ||
| - webpack/runtime/get_full_hash | ||
|
|
||
| #### Changed Content | ||
| ```js | ||
| "use strict"; | ||
| self["webpackHotUpdate"]("main", { | ||
| "./stylesheet.css.js": | ||
| /*!***************************!*\ | ||
| !*** ./stylesheet.css.js ***! | ||
| \***************************/ | ||
| (function (module) { | ||
| module.exports = "body { background: url(\"https://test.cases/path/assets/file.jpg\"); color: #00f; }"; | ||
|
|
||
| }), | ||
|
|
||
| },function(__webpack_require__) { | ||
| // webpack/runtime/get_full_hash | ||
| (() => { | ||
| __webpack_require__.h = () => ("CURRENT_HASH") | ||
| })(); | ||
|
|
||
| } | ||
| ); | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
|
|
||
| ## Runtime | ||
| ### Status | ||
|
|
||
| ```txt | ||
| check => prepare => dispose => apply => idle | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ### JavaScript | ||
|
|
||
| #### Outdated | ||
|
|
||
| Outdated Modules: | ||
| - ./stylesheet.css.js | ||
|
|
||
|
|
||
| Outdated Dependencies: | ||
| ```json | ||
| { | ||
| "./index.js": [ | ||
| "./stylesheet.css.js" | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| #### Updated | ||
|
|
||
| Updated Modules: | ||
| - ./stylesheet.css.js | ||
|
|
||
| Updated Runtime: | ||
| - `__webpack_require__.h` | ||
|
|
||
|
|
||
| #### Callback | ||
|
|
||
| Accepted Callback: | ||
| - ./stylesheet.css.js | ||
|
|
||
| Disposed Callback: |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.