
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@stylable/experimental-loader
Advanced tools
This loader supports working with `mini-css-extract-plugin`. Internally, this setup uses two separate loaders.
This loader supports working with mini-css-extract-plugin
. Internally, this setup uses two separate loaders.
stylable-transform-loader
- responsible for Stylable transformations and generates the css-loader
compatible output that the mini-css-extract-plugin
expectsstylable-runtime-loader
- Stylable offers a richer module API compared to css modules. The css-loader
flow does not support this API, and so we are using this loader to convert the raw Stylable locals data to the appropriate runtime stylesheetThis loader is experimental and currently not the recommended way of integrating Stylable into your project.
Use @stylable/webpack-plugin
for the latest stable integration.
A minimal webpack configuration using the two Stylable loaders in conjunction with the mini-css-extract-plugin
loader:
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { stylableLoaders } = require('@stylable/experimental-loader');
module.exports = {
plugins: [new MiniCssExtractPlugin()],
module: {
rules: [
{
test: /\.st\.css$/i,
use: [
stylableLoaders.runtime(),
MiniCssExtractPlugin.loader,
stylableLoaders.transform(),
],
},
// load asset from CSS url()
{
test: /\.(png|jpg|gif)$/i,
use: [
{
loader: 'url-loader',
options: {
limit: 8192,
},
},
],
},
],
},
};
interface LoaderOptions {
resolveNamespace?(namespace: string, filePath: string): string;
filterUrls?(url: string, ctx: loader.LoaderContext): boolean;
exportsOnly?: boolean;
alwaysEmitErrors?: boolean;
}
Option | Description |
---|---|
resolveNamespace | override default stylesheet namespace process |
filterUrls | filter urls from webpack process |
exportsOnly | only export the runtime stylesheet |
alwaysEmitErrors | always emit Stylable diagnostics as errors |
When building Stylable for consumption in a server-side renderer build, you may want to extract only the exports of the runtime stylesheets and not the content of their CSS. In such a case you would only be required to use the transform
loader and the exportsOnly
option.
{
test: /\.st\.css$/i,
use: [
stylableLoaders.transform({ exportsOnly: true }),
],
}
As opposed to the current webpack-plugin integration, some behaviors are still missing, or lacking:
Copyright (c) 2021 Wix.com Ltd. All Rights Reserved. Use of this source code is governed by a MIT license.
FAQs
This loader supports working with `mini-css-extract-plugin`. Internally, this setup uses two separate loaders.
The npm package @stylable/experimental-loader receives a total of 155 weekly downloads. As such, @stylable/experimental-loader popularity was classified as not popular.
We found that @stylable/experimental-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.