Skip to content

Commit 25ca8b5

Browse files
authored
Merge pull request #7 from mpech/main
enable customAtRules to be given in options
2 parents 39a134e + d163817 commit 25ca8b5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ build({
4646
// Add your own or other plugins in the "visitor" section see
4747
// https://lightningcss.dev/transforms.html
4848
// visitor: myLightningcssPlugin(),
49+
// customAtRules: { myLigningCssRule1: {...} }
4950
targets: {
5051
chrome: 80 // aligns somewhat to es2020
5152
},
@@ -77,3 +78,5 @@ If this is not the case, and they end with `.css` while you still want to exclud
7778
includeFilter: /\.css$/,
7879
excludeFilter: /@fortawesome\/fontawesome-svg-core\/|my-normal-css-file\.css|normalize\.css/,
7980
```
81+
82+
### ``

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const { dirname, join } = require("path");
1212
* @param {import("lightningcss").TransformOptions["visitor"]=} options.visitor
1313
* @param {import("lightningcss").TransformOptions["targets"]=} options.targets
1414
* @param {import("lightningcss").TransformOptions["drafts"]=} options.drafts
15+
* @param {import("lightningcss").TransformOptions["customAtRules"]=} options.customAtRules
1516
* @param {import("lightningcss").CSSModulesConfig["pattern"]=} options.cssModulesPattern
1617
* @param {import("lightningcss").CSSModulesConfig=} options.cssModules
1718
* @return {import("esbuild").Plugin}
@@ -57,6 +58,7 @@ const cssModules = (options = {}) => {
5758
targets: options.targets,
5859
drafts: options.drafts,
5960
visitor: options.visitor,
61+
customAtRules: options.customAtRules,
6062
// this way the correct relative path for the source map will be generated ;)
6163
projectRoot: join(initialOptions.absWorkingDir || process.cwd(), initialOptions.outdir)
6264
});

0 commit comments

Comments
 (0)