Skip to content

Commit

Permalink
Merge pull request #7 from mpech/main
Browse files Browse the repository at this point in the history
enable customAtRules to be given in options
  • Loading branch information
jonnitto authored Dec 1, 2023
2 parents 39a134e + d163817 commit 25ca8b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ build({
// Add your own or other plugins in the "visitor" section see
// https://lightningcss.dev/transforms.html
// visitor: myLightningcssPlugin(),
// customAtRules: { myLigningCssRule1: {...} }
targets: {
chrome: 80 // aligns somewhat to es2020
},
Expand Down Expand Up @@ -77,3 +78,5 @@ If this is not the case, and they end with `.css` while you still want to exclud
includeFilter: /\.css$/,
excludeFilter: /@fortawesome\/fontawesome-svg-core\/|my-normal-css-file\.css|normalize\.css/,
```

### ``
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const { dirname, join } = require("path");
* @param {import("lightningcss").TransformOptions["visitor"]=} options.visitor
* @param {import("lightningcss").TransformOptions["targets"]=} options.targets
* @param {import("lightningcss").TransformOptions["drafts"]=} options.drafts
* @param {import("lightningcss").TransformOptions["customAtRules"]=} options.customAtRules
* @param {import("lightningcss").CSSModulesConfig["pattern"]=} options.cssModulesPattern
* @param {import("lightningcss").CSSModulesConfig=} options.cssModules
* @return {import("esbuild").Plugin}
Expand Down Expand Up @@ -57,6 +58,7 @@ const cssModules = (options = {}) => {
targets: options.targets,
drafts: options.drafts,
visitor: options.visitor,
customAtRules: options.customAtRules,
// this way the correct relative path for the source map will be generated ;)
projectRoot: join(initialOptions.absWorkingDir || process.cwd(), initialOptions.outdir)
});
Expand Down

0 comments on commit 25ca8b5

Please sign in to comment.