@fibrae/semi-webpack-plugin weekly downloads statistics
By fibrae · npm · Webpack plugins
webpack 5 plugin of Semi Design Next: replaces the CSS class prefix, controls the CSS cascade layer, removes style imports and customizes the style loaders.
@fibrae/semi-webpack-plugin has 344 recorded weekly downloads on npm, a decrease of 42.4% over the past 30 days, ranking #2350 of 3,247 tracked listings.
About @fibrae/semi-webpack-plugin
@fibrae/semi-webpack-plugin
The webpack 5 build plugin of Semi Design Next (SemiWebpackPlugin), for webpack applications that use the Semi component packages. It replaces the CSS class prefix, controls whether styles are wrapped in @layer semi, removes the .css imports inside Semi packages (for Next.js), and lets you customize the style loader chain. @fibrae/semi-next builds on it.
Styles are customized through --semi-* CSS variables (see tokens) and your own unlayered CSS, which always wins over styles inside @layer semi. The plugin has no compile-time theme or variables options.
Installation
pnpm add -D @fibrae/semi-webpack-plugin
Peer dependency: webpack 5 (optional; at runtime the plugin takes the host's webpack through compiler.webpack, while the type declarations still reference webpack). Ships ESM only.
Usage
// webpack.config.mjs
import SemiWebpackPlugin from '@fibrae/semi-webpack-plugin';
export default {
plugins: [
new SemiWebpackPlugin({
prefixCls: 'custom', // .semi-button -> .custom-button
}),
],
};
Besides the default export, the package has the named type SemiWebpackPluginOptions and the loader functions semiScssLoader, semiPrefixLoader and semiSourceSuffixLoader.
Hosts that reference loaders by path (such as turbopack.rules in Next.js) get the loader files from subpath exports, for example require.resolve('@fibrae/semi-webpack-plugin/semi-omit-css-loader'):
| Subpath | Purpose |
|---|---|
./semi-omit-css-loader | Comments out .css imports in JS |
./semi-prefix-loader | Rewrites constants in env.js, such as BASE_CLASS_PREFIX, according to options.replacers |
Options
| Option | Type | Default | Description |
|---|---|---|---|
prefixCls | string | semi | CSS class prefix. Also rewrites BASE_CLASS_PREFIX in Semi's JS, including under omitCss. |
cssLayer | boolean | true | Whether compiled styles are wrapped in @layer semi { ... }. false outputs unlayered styles. |
omitCss | boolean | false | Removes the .css imports from JS under dist in Semi packages and stops compiling styles. Styles come from a full stylesheet the application imports. |
extractCssOptions | { loader: string; loaderOptions?: any } | None | The loader that extracts CSS (such as the mini-css-extract-plugin loader). Without it, style-loader is used. |
overrideStylesheetLoaders | (loaders: any[]) => any[] | None | Receives the default loader list (already including extractCssOptions) and returns a new list. Prefer appending your own loaders over removing or changing the defaults. |
omitCss and cssLayer are mutually exclusive: with no styles compiled, cssLayer has nothing to act on, and passing both throws in the constructor. For an unlayered stylesheet, generate it with @fibrae/semi-scss-compile (semi-build-scss --no-layer) and keep its --prefix the same as prefixCls.
How it works
- Semi's JS imports the compiled
.css. The plugin appendssemi-source-suffix-loaderto the JS underdistof the Semi framework packages (UI, AI, icons), which points those imports back to.scss. dist/**/*.scssuses[style-loader or extractCssOptions.loader, css-loader, semi-scss-loader].semi-scss-loadercompiles through thesemi:Sass importer, withsemi:themecoming from@fibrae/semi-foundation/theme/index.scssand$prefixfromprefixCls.- It gets the running webpack instance through
compiler.webpack, so it works in Next.js, which bundles its own webpack.
Related packages
- Bundles
@fibrae/semi-scss-compile/coreintodistat build time. Runtime dependencies arecss-loader,style-loaderandsass. - Depended on by
@fibrae/semi-next. - Sibling plugins:
@fibrae/semi-vite-pluginand@fibrae/semi-rspack-plugin.
Development
webpack loads loaders by file path, so vp pack emits each source file as a separate dist file in unbundle mode.
pnpm --filter @fibrae/semi-webpack-plugin build: builds.vp test run --project plugins packages/plugins/semi-webpack(from the repository root, aftervp run --filter './packages/plugins/**' build): uses__tests__/webpack.test.tsto run fixture builds against thedistoutput (entry,vue-entryandai-entry).
For general commands, see CONTRIBUTING.md at the repository root.
Description from the npm listing.
- webpack
- webpack-plugin
- css-layer
- semi-design
- semi-design-next
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (121)Similar npm Webpack plugins plugins
All 20 @fibrae/semi-webpack-plugin alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@fibrae/semi-webpack-plugin. First seen Dec 4, 2026; last successful collection Dec 6, 2026. See the methodology.