-
-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: build error with reserved keywords in CSS modules (#9439)
- Loading branch information
Showing
4 changed files
with
36 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
15 changes: 15 additions & 0 deletions
15
packages/rspack-test-tools/tests/configCases/css/rspack-issue-9432/index.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,15 @@ | ||
import * as styles from "./index.module.css"; | ||
|
||
styles["switch"]; | ||
styles["default"]; | ||
|
||
it("should works", async () => { | ||
const fs = __non_webpack_require__("fs"); | ||
const path = __non_webpack_require__("path"); | ||
const js = await fs.promises.readFile( | ||
path.resolve(__dirname, "./bundle0.js"), | ||
"utf-8" | ||
); | ||
expect(js).toContain("_switch = "); | ||
expect(js).toContain("_default = "); | ||
}); |
7 changes: 7 additions & 0 deletions
7
packages/rspack-test-tools/tests/configCases/css/rspack-issue-9432/index.module.css
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,7 @@ | ||
.switch { | ||
display: block; | ||
} | ||
|
||
.default { | ||
display: block; | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/rspack-test-tools/tests/configCases/css/rspack-issue-9432/rspack.config.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,10 @@ | ||
/** @type {import("@rspack/core").Configuration} */ | ||
module.exports = { | ||
target: "node", | ||
optimization: { | ||
concatenateModules: true | ||
}, | ||
experiments: { | ||
css: true | ||
} | ||
}; |
4b72f57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Ecosystem CI detail: Open
4b72f57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Benchmark detail: Open
Threshold exceeded: ["arco-pro_production-mode_persistent-hot + exec"]