![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
esbuild-css-modules-server-plugin
Advanced tools
esbuild plugin for bundling CSS module files for server-side rendering
Deprecation Notice
This library is deprecated. Use esbuild-ssr-css-modules-plugin
instead.
Deprecation Notice
This esbuild Plugin bundles CSS module files for usage in server-side script for server-side rendering.
Thus, import directives such as the following can be used alongside React components:
import styles from './Panel.module.css';
For creating client-side bundles, see esbuild-css-modules-client-plugin
(1) Install this plugin as a dependency for your project:
npm i esbuild-css-modules-server-plugin
# -- or
yarn add esbuild-css-modules-server-plugin
(2) Add this plugin to the list of plugins supplied to esbuild:
import cssServerPlugin from 'esbuild-css-modules-server-plugin';
const res = await build({
plugins: [cssServerPlugin()],
});
The plugin supports one option onCSSGenerated
. This option accepts a callback function that receives one argument css
that contains snippets of CSS generated.
import cssPlugin from 'esbuild-css-modules-server-plugin';
const generatedCss: string[] = [];
const res = await build({
plugins: [
cssPlugin({
onCSSGenerated: (css) => {
generatedCss.push(css);
},
}),
],
});
console.log(generatedCss.join('\n'));
This can be useful for creating a CSS bundle that can be shipped with the other files packaged for the server. When generating a client-side bundle using esbuild-css-modules-client-plugin
, the option excludeCSSInject
can then be set to true for a better page load experience (no flicker of the page once CSS is injected).
This plugin will transform .css
files into JavaScript source files that contain:
Thus, when server-side rendering is performed, class names can be resolved to the transformed counter-parts and the HTML rendered with the correct class names.
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 server-side rendering
We found that esbuild-css-modules-server-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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.