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 2.6.3 to 2.6.4-dev.0

19

lib/utils.js

@@ -69,9 +69,9 @@ const path = require('path');

return `
(function(){
(function(win){
const css = \`${css}\`;
const doInject = () => {
if (typeof document === 'undefined') {
if (typeof win.document === 'undefined') {
return;
}
let root = document.querySelector('${injectToSelector}');
let root = win.document.querySelector('${injectToSelector}');
if (root && root.shadowRoot) {

@@ -81,16 +81,15 @@ root = root.shadowRoot;

if (!root) {
root = document.head;
root = win.document.head;
}
let container = root.querySelector('#_${digest}');
if (!container) {
container = document.createElement('style');
container = win.document.createElement('style');
container.id = '_${digest}';
const text = win.document.createTextNode(css);
container.appendChild(text);
root.appendChild(container);
}
const text = document.createTextNode(css);
container.appendChild(text);
delete window.__inject_${digest}__;
}
window.__inject_${digest}__ = doInject;
})();
win.__inject_${digest}__ = doInject;
})(globalThis);
`;

@@ -97,0 +96,0 @@ };

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

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

"test": "cd ./test && node test.js",
"pub": "npm_config_registry=https://registry.npmjs.org/ npm publish --userconfig ~/.pubnpmrc --access public"
"pub": "npm_config_registry=https://registry.npmjs.org/ npm publish --userconfig ~/.pubnpmrc --access public --tag latest"
},

@@ -24,0 +24,0 @@ "devDependencies": {

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