Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rspack/plugin-postcss

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rspack/plugin-postcss - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

6

CHANGELOG.md
# rspack-plugin-postcss
## 0.0.10
### Patch Changes
- @rspack/binding@0.0.10
## 0.0.9

@@ -4,0 +10,0 @@

4

package.json
{
"name": "@rspack/plugin-postcss",
"version": "0.0.9",
"version": "0.0.10",
"description": "",

@@ -8,3 +8,3 @@ "main": "src/index.js",

"dependencies": {
"@rspack/binding": "0.0.9",
"@rspack/binding": "0.0.10",
"postcss-modules": "^5.0.0",

@@ -11,0 +11,0 @@ "postcss-pxtorem": "^6.0.0"

@@ -9,2 +9,4 @@ const { Processor } = require("postcss");

const IS_MODULES = /\.module(s)?\.\w+$/i;
module.exports = async function loader(loaderContext) {

@@ -14,3 +16,3 @@ // TODO: customize options, until js binding support this functionality

let options = loaderContext.getOptions() ?? {};
let enableModules = options.modules;
let modulesOptions = options.modules;
let pxToRem = options.pxToRem;

@@ -46,12 +48,29 @@ let useSourceMap =

if (enableModules) {
plugins.push(
cssModules({
getJSON(_, json) {
if (json) {
meta = json;
if (modulesOptions) {
let auto =
typeof modulesOptions === "boolean"
? true
: modulesOptions.auto ?? true;
let isModules;
if (typeof auto === "boolean") {
isModules = auto && IS_MODULES.test(loaderContext.resourcePath);
} else if (auto instanceof RegExp) {
isModules = auto.test(loaderContext.resourcePath);
} else if (typeof auto === "function") {
isModules = auto(loaderContext.resourcePath);
}
delete modulesOptions.auto;
if (isModules) {
plugins.push(
cssModules({
...modulesOptions,
getJSON(_, json) {
if (json) {
meta = json;
}
}
}
})
);
})
);
}
}

@@ -58,0 +77,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc