New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ladifire-opensource/stylex-nextjs-plugin

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ladifire-opensource/stylex-nextjs-plugin - npm Package Compare versions

Comparing version 0.0.1-beta.0 to 0.0.1-beta.1.0

index.js

9

package.json
{
"name": "@ladifire-opensource/stylex-nextjs-plugin",
"version": "0.0.1-beta.0",
"version": "0.0.1-beta.1.0",
"description": "Transform Stylex code",

@@ -14,3 +14,4 @@ "license": "MIT",

"dist",
"src"
"src",
"index.js"
],

@@ -22,5 +23,5 @@ "repository": {

"dependencies": {
"@ladifire-opensource/stylex-webpack-plugin": "0.0.1-beta.0"
"@ladifire-opensource/stylex-webpack-plugin": "0.0.1-beta.1.0"
},
"gitHead": "c9a6a6486bda2d68e05ac48b9860e7702ca8e84c"
"gitHead": "4724bf02422b39e9eede98cfff8d7b624d100dee"
}
// license by johanholmerin
const StylexPlugin = require('@ladifire-opensource/stylex-webpack-plugin');
const StylexPlugin = require("@ladifire-opensource/stylex-webpack-plugin");
const {
getClientStyleLoader
} = require('next/dist/build/webpack/config/blocks/css/loaders/client');
const {stringifyCssRequest} = require('./utils');
} = require("next/dist/build/webpack/config/blocks/css/loaders/client");
const {stringifyCssRequest} = require("./utils");
function getInlineLoader(options) {
const outputLoaders = [
{ loader: 'css-loader' }
{loader: "css-loader"}
];

@@ -26,33 +26,31 @@

module.exports = (pluginOptions = {}) => (nextConfig = {}) => {
return {
...nextConfig,
webpack(config, options) {
const outputCSS = !options.isServer;
module.exports = (pluginOptions = {}) => (nextConfig = {}) => ({
...nextConfig,
webpack(config, options) {
const outputCSS = !options.isServer;
config.module.rules.unshift({
test: /\.(tsx|ts|js|mjs|jsx)$/,
use: [
{
loader: StylexPlugin.loader,
options: {
inlineLoader: getInlineLoader(options),
outputCSS,
...pluginOptions
}
config.module.rules.unshift({
test: /\.(tsx|ts|js|mjs|jsx)$/,
use: [
{
loader: StylexPlugin.loader,
options: {
inlineLoader: getInlineLoader(options),
outputCSS,
...pluginOptions
}
]
});
}
]
});
if (outputCSS) {
config.plugins.push(new StylexPlugin());
}
if (outputCSS) {
config.plugins.push(new StylexPlugin());
}
if (typeof nextConfig.webpack === 'function') {
return nextConfig.webpack(config, options);
}
if (typeof nextConfig.webpack === "function") {
return nextConfig.webpack(config, options);
}
return config;
}
};
};
return config;
}
});
function stringifyCssRequest(outputLoaders) {
const cssLoaders = outputLoaders.map(stringifyLoaderRequest).join('!');
const cssLoaders = outputLoaders.map(stringifyLoaderRequest).join("!");

@@ -7,6 +7,6 @@ return `!${cssLoaders}!`;

function stringifyLoaderRequest({ loader, options = {} }) {
function stringifyLoaderRequest({loader, options = {}}) {
return `${loader}?${JSON.stringify(options)}`;
}
module.exports = { stringifyCssRequest, stringifyLoaderRequest };
module.exports = {stringifyCssRequest, stringifyLoaderRequest};
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