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.0-d2f7a90ee-20221109135547 to 0.0.0-d44477f1cd-20221123153407

35

CHANGELOG.md
# rspack-plugin-postcss
## 0.0.0-d2f7a90ee-20221109135547
## 0.0.0-d44477f1cd-20221123153407
### Patch Changes
- e6d0926a2: unify version
- Updated dependencies [e6d0926a2]
- @rspack/binding@0.0.0-d2f7a90ee-20221109135547
- @rspack/binding@0.0.0-d44477f1cd-20221123153407
## 0.0.10
### Patch Changes
- @rspack/binding@0.0.10
## 0.0.9
### Patch Changes
- Updated dependencies [69becfa5]
- @rspack/binding@0.0.9
## 0.0.8
### Patch Changes
- 589b99bb: bump to 0.0.8
- Updated dependencies [589b99bb]
- @rspack/binding@0.0.8
## 0.0.6
### Patch Changes
- e6d0926a: unify version
- Updated dependencies [e6d0926a]
- @rspack/binding@0.0.6
## 0.0.4

@@ -12,0 +39,0 @@

13

package.json
{
"name": "@rspack/plugin-postcss",
"version": "0.0.0-d2f7a90ee-20221109135547",
"version": "0.0.0-d44477f1cd-20221123153407",
"description": "",

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

"dependencies": {
"@rspack/binding": "0.0.0-d2f7a90ee-20221109135547",
"postcss-modules": "^5.0.0",
"postcss-pxtorem": "^6.0.0"
"postcss-pxtorem": "^6.0.0",
"postcss": "^8.4.16",
"@rspack/binding": "0.0.0-d44477f1cd-20221123153407"
},
"peerDependencies": {
"postcss": "^7.0.0 || ^8.0.1"
},
"devDependencies": {
"postcss": "^8.4.16"
},
"author": "",

@@ -20,0 +15,0 @@ "license": "ISC",

@@ -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