
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
esbuild-css-modules-client-plugin
Advanced tools
esbuild plugin for bundling CSS module files for client-side scripts
Deprecation Notice
This library is deprecated. Use esbuild-ssr-css-modules-plugin
instead.
Deprecation Notice
This esbuild Plugin bundles CSS module files along with client-side JavaScript.
Thus, import directives such as the following can be used alongside React components:
import styles from './Panel.module.css';
For creating bundles for server-side rendering, see esbuild-css-modules-server-plugin
(1) Install this plugin as a dependency for your project:
npm i esbuild-css-modules-client-plugin
# -- or
yarn add esbuild-css-modules-client-plugin
(2) Add this plugin to the list of plugins supplied to esbuild:
import cssPlugin from 'esbuild-css-modules-client-plugin';
const res = await build({
plugins: [cssPlugin()],
});
The plugin supports the option excludeCSSInject
. This defaults to false
. When set, no <script>
tags are injected to be run during script load.
import cssPlugin from 'esbuild-css-modules-client-plugin';
const res = await build({
plugins: [
cssPlugin({
excludeCSSInject: true,
}),
],
});
This plugin will transform .css
files into JavaScript source files that contain:
<script>
tag when the script is loaded that contains the CSS (with transformed class names as per CSS module specification)Thus, when the client-side bundle is loaded, all required CSS will be injected into the page and we can use the styles
object to resolve original class names to the transformed ones.
esbuild-plugin-css-in-js
: Plugin that includes plain CSS (instead of CSS with transformed classnames according to the CSS modules standard as this plugin does)node-css-require
: Library used for CSS module transformationFAQs
esbuild plugin for bundling CSS module files for client-side scripts
We found that esbuild-css-modules-client-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.