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

esbuild-css-modules-plugin

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-css-modules-plugin - npm Package Compare versions

Comparing version 3.0.0-dev.7 to 3.0.0-dev.8

2

index.js

@@ -18,4 +18,2 @@ import { basename, dirname, extname, normalize, relative, resolve, sep } from 'node:path';

// TODO not generate inject code on load, but on end
/**

@@ -22,0 +20,0 @@ * @type {(options: import('./index.js').Options) => import('esbuild').Plugin}

18

lib/css.helper.js

@@ -10,3 +10,3 @@ import { bundle as bundleModulesCss } from 'lightningcss';

} from './utils.js';
import { camelCase, sortBy, uniq, upperFirst } from 'lodash-es';
import { camelCase, sortBy, uniq, uniqBy, upperFirst } from 'lodash-es';
import { injectorVirtualPath, pluginJsNamespace } from './utils.js';

@@ -164,5 +164,7 @@

/** @type {Set<string>} */
const nameSet = new Set();
/** @type {[string, string][]} */
const jsNames = [];
/** @type {[string, string][]} */

@@ -185,9 +187,15 @@ const originNames = [];

}
jsLines.push(`export const ${jsName} = "${localName}";`);
if (!nameSet.has(jsName)) {
jsLines.push(`export const ${jsName} = "${localName}";`);
}
}
jsNames.push([jsName, supportNamedExports ? jsName : `"${localName}"`]);
if (keepOrigin && origin !== jsName) {
originNames.push([origin, supportNamedExports ? jsName : `"${localName}"`]);
nameSet.add(origin);
}
nameSet.add(jsName);
});

@@ -201,3 +209,3 @@

export default new Proxy({
${uniq([...jsNames, ...originNames])
${uniqBy([...jsNames, ...originNames], '0')
.map(([o, l]) => ` "${o}": ${l}`)

@@ -215,3 +223,3 @@ .join(',\n')}

export default {
${uniq([...jsNames, ...originNames])
${uniqBy([...jsNames, ...originNames], '0')
.map(([o, l]) => ` "${o}": ${l}`)

@@ -218,0 +226,0 @@ .join(',\n')}

{
"name": "esbuild-css-modules-plugin",
"version": "3.0.0-dev.7",
"version": "3.0.0-dev.8",
"description": "A esbuild plugin to bundle css modules into js(x)/ts(x).",

@@ -5,0 +5,0 @@ "main": "./index.js",

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