New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-css-require

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-css-require - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

8

dist/src/nodeCssRequire.d.ts

@@ -0,1 +1,3 @@

import { AcceptedPlugin } from 'postcss';
export type { AcceptedPlugin } from 'postcss';
export interface CompileCssResult {

@@ -5,4 +7,8 @@ css: string;

}
export declare function compileCss(code: string, filename: string): CompileCssResult;
export interface CompileCssConfiguration {
plugins?: AcceptedPlugin[];
generateScopedName?: string;
}
export declare function compileCss(code: string, filename: string, config?: CompileCssConfiguration): CompileCssResult;
export declare const register: () => void;
//# sourceMappingURL=nodeCssRequire.d.ts.map

12

dist/src/nodeCssRequire.js

@@ -12,7 +12,7 @@ "use strict";

const register_1 = require("@swc-node/register/register");
function compileCss(code, filename) {
function compileCss(code, filename, config) {
let exportedTokens = {};
const res = (0, postcss_1.default)([
const plugins = [
(0, postcss_modules_sync_1.default)({
generateScopedName: '[path][local]-[hash:base64:10]',
generateScopedName: (config === null || config === void 0 ? void 0 : config.generateScopedName) || '[path][local]-[hash:base64:10]',
getJSON: (tokens) => {

@@ -22,3 +22,7 @@ exportedTokens = tokens;

}),
]).process(code, { from: filename });
];
if (config === null || config === void 0 ? void 0 : config.plugins) {
plugins.push(...config.plugins);
}
const res = (0, postcss_1.default)(plugins).process(code, { from: filename });
// the below is required to properly resolve `exportedTokens`

@@ -25,0 +29,0 @@ res

{
"name": "node-css-require",
"version": "0.1.3",
"version": "0.1.4",
"description": "Load CSS modules when running Node.js CLI and server applications",

@@ -42,5 +42,5 @@ "keywords": [

"devDependencies": {
"@goldstack/utils-git": "0.1.36",
"@types/jest": "^27.5.1",
"@types/node": "^17.0.33",
"@goldstack/utils-git": "0.1.37",
"@types/jest": "^28.1.8",
"@types/node": "^18.7.13",
"jest": "^28.1.0",

@@ -47,0 +47,0 @@ "rimraf": "^3.0.2",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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