Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16903 from janlent1/fixruntimeissue
Fix runtime generation bug
- Loading branch information
Showing
11 changed files
with
94 additions
and
3 deletions.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import * as style from "./styles.js"; | ||
export default style; |
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,2 @@ | ||
import * as style from "./styles.js"; | ||
export default style; |
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,14 @@ | ||
const img = new URL("./img.png", import.meta.url); | ||
|
||
it("should allow to create css modules", done => { | ||
import("./asyncChunk").then(({ default: x }) => { | ||
try { | ||
expect(img.toString()).toBe("https://test.cases/path/img.png"); | ||
expect(x.default.class).toEqual("./test.module.css-class"); | ||
} catch (e) { | ||
return done(e); | ||
} | ||
|
||
done(); | ||
}, done); | ||
}); |
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,14 @@ | ||
const img = new URL("./img.png", import.meta.url); | ||
|
||
it("should allow to create css modules", done => { | ||
import("./asyncChunk2").then(({ default: x }) => { | ||
try { | ||
expect(img.toString()).toBe("https://test.cases/path/img.png"); | ||
expect(x.default.class).toEqual("./test.module.css-class"); | ||
} catch (e) { | ||
return done(e); | ||
} | ||
|
||
done(); | ||
}, done); | ||
}); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,2 @@ | ||
import * as style from "./test.module.css"; | ||
export default style; |
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,21 @@ | ||
module.exports = { | ||
moduleScope(scope) { | ||
const link1 = scope.window.document.createElement("link"); | ||
link1.rel = "stylesheet"; | ||
link1.href = "asyncChunk_js.css"; | ||
scope.window.document.head.appendChild(link1); | ||
const link2 = scope.window.document.createElement("link"); | ||
link2.rel = "stylesheet"; | ||
link2.href = "asyncChunk_js2.css"; | ||
scope.window.document.head.appendChild(link2); | ||
}, | ||
findBundle: function (i, options) { | ||
return [ | ||
"./common-share_js-img_png.js", | ||
"./asyncChunk_js.js", | ||
"./main.js", | ||
"./secondMain.js", | ||
"./asyncChunk2_js.js" | ||
]; | ||
} | ||
}; |
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 @@ | ||
.class { | ||
background-image: url('./img.png'); | ||
} |
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,34 @@ | ||
/** @type {import("../../../../").Configuration} */ | ||
module.exports = { | ||
target: "web", | ||
mode: "development", | ||
experiments: { | ||
css: true | ||
}, | ||
entry: { | ||
main: { | ||
import: ["./share.js", "./entry1.js"] | ||
}, | ||
secondMain: { | ||
import: ["./share.js", "./entry2.js"] | ||
} | ||
}, | ||
optimization: { | ||
splitChunks: { | ||
chunks: "all", | ||
cacheGroups: { | ||
common: { | ||
name: false, | ||
chunks: "all", | ||
test() { | ||
return true; | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
output: { | ||
filename: "[name].js", | ||
assetModuleFilename: "[name][ext]" | ||
} | ||
}; |