-
-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: using object form of lightningcss feature options (#7311)
- Loading branch information
Showing
9 changed files
with
261 additions
and
95 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...es/rspack-test-tools/tests/configCases/builtin-lightningcss-loader/basic-include/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,6 @@ | ||
import * as styles from './index.module.css' | ||
|
||
it("should transform css correct", () => { | ||
expect(styles).toHaveProperty('used'); | ||
expect('unused' in styles).toBeFalsy(); | ||
}); |
9 changes: 9 additions & 0 deletions
9
...k-test-tools/tests/configCases/builtin-lightningcss-loader/basic-include/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,9 @@ | ||
body { | ||
.used { | ||
color: blue | ||
} | ||
|
||
.unused { | ||
color: red | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...k-test-tools/tests/configCases/builtin-lightningcss-loader/basic-include/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,35 @@ | ||
const rspack = require('@rspack/core') | ||
const browserslist = require('browserslist') | ||
|
||
/** @type {import("@rspack/core").Configuration} */ | ||
module.exports = { | ||
module: { | ||
parser: { | ||
'css/auto': { | ||
namedExports: true | ||
} | ||
}, | ||
rules: [ | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
{ | ||
loader: "builtin:lightningcss-loader", | ||
/** @type {import("@rspack/core").LightningcssLoaderOptions} */ | ||
options: { | ||
unusedSymbols: ['unused'], | ||
targets: 'ie 10', | ||
include: { | ||
nesting: true | ||
} | ||
} | ||
} | ||
], | ||
type: "css/auto" | ||
} | ||
] | ||
}, | ||
experiments: { | ||
css: true | ||
} | ||
}; |
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
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
Oops, something went wrong.
52dd72e
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
52dd72e
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.
📝 Ran ecosystem CI: Open