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

esbuild-css-modules-server-plugin

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.1.1 to 0.1.2

5

dist/src/esbuildCssModulesServerPlugin.d.ts
import { Plugin } from 'esbuild';
declare const pluginFactory: () => Plugin;
export interface CSSServerPluginOptions {
onCSSGenerated?: (css: string) => void;
}
declare const pluginFactory: (opts?: CSSServerPluginOptions) => Plugin;
export default pluginFactory;
//# sourceMappingURL=esbuildCssModulesServerPlugin.d.ts.map

38

dist/src/esbuildCssModulesServerPlugin.js

@@ -8,19 +8,27 @@ "use strict";

const node_css_require_1 = require("node-css-require");
const cssServerPlugin = {
name: 'css-plugin-server',
setup: (build) => {
build.onLoad({
filter: /\.css$/,
}, async (args) => {
const text = await fs_1.default.promises.readFile(args.path, 'utf8');
const js = (0, node_css_require_1.compileCss)(text, args.path).js;
return {
contents: js,
loader: 'js',
};
});
},
const cssServerPlugin = (opts) => {
return {
name: 'css-plugin-server',
setup: (build) => {
build.onLoad({
filter: /\.css$/,
}, async (args) => {
const text = await fs_1.default.promises.readFile(args.path, 'utf8');
const res = (0, node_css_require_1.compileCss)(text, args.path);
const js = res.js;
if (opts === null || opts === void 0 ? void 0 : opts.onCSSGenerated) {
opts.onCSSGenerated(res.css);
}
return {
contents: js,
loader: 'js',
};
});
},
};
};
const pluginFactory = () => cssServerPlugin;
const pluginFactory = (opts) => {
return cssServerPlugin(opts);
};
exports.default = pluginFactory;
//# sourceMappingURL=esbuildCssModulesServerPlugin.js.map
{
"name": "esbuild-css-modules-server-plugin",
"version": "0.1.1",
"version": "0.1.2",
"description": "esbuild plugin for bundling CSS module files for server-side rendering",

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

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