Registry / devops / webpack-rtl-plugin

webpack-rtl-plugin

JSON →
library2.0.0jsnpmunverified

Webpack plugin that generates an additional right-to-left (RTL) CSS bundle alongside the original LTR stylesheet using mini-css-extract-plugin. Current stable version 2.0.0, with irregular releases. Under the hood it uses rtlcss for CSS transformation. Key differentiator: it is a dedicated Webpack plugin, unlike standalone rtlcss or postcss-rtl which require separate loaders or post-processing. It supports content hashing in filenames, diff-only output, minification via cssnano, and custom rtlcss options/plugins.

npm install webpack-rtl-plugin
INSTALL
IMPORT
SIG · WEBPACK-RTL-PLUGIN
W
webpack-rtl-plugin
devopsjavascriptv2.0.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WebpackRTLPlugin
✓ const WebpackRTLPlugin = require('webpack-rtl-plugin')
✗ import WebpackRTLPlugin from 'webpack-rtl-plugin'
The package does not ship TypeScript definitions and uses CommonJS; named import via ES is unsupported. Use require.
WebpackRTLPlugin
✓ const WebpackRTLPlugin = require('webpack-rtl-plugin').default
✗ const WebpackRTLPlugin = require('webpack-rtl-plugin')
Some versions mistakenly exported default. Check package; usually require('webpack-rtl-plugin') works directly.
WebpackRTLPlugin
✓ import WebpackRTLPlugin from 'webpack-rtl-plugin'
If using TypeScript with esModuleInterop or bundlers that support CJS interop, this may work but is not officially supported.

Shows basic usage: add plugin after MiniCssExtractPlugin, output LTR and RTL CSS bundles.

const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const WebpackRTLPlugin = require('webpack-rtl-plugin'); const path = require('path'); module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js', }, module: { rules: [ { test: /\.css$/, use: [ MiniCssExtractPlugin.loader, 'css-loader' ] } ] }, plugins: [ new MiniCssExtractPlugin({ filename: 'style.css' }), new WebpackRTLPlugin({ filename: 'style.rtl.css', minify: true }) ] };
Debug
Known issues
gotchaPlugin does not work without mini-css-extract-plugin; ensure it is installed and configured.
fix
Add mini-css-extract-plugin to your devDependencies and instantiate it before WebpackRTLPlugin.
affects: >=1.0.0
deprecatedThe 'filename' option has changed between versions; earlier versions used a different placeholder syntax.
fix
Update to version 2.0.0 and use bracket placeholders like '[name].rtl.css'.
affects: <2.0.0
gotchaThe default filename overrides the original CSS file name if not set explicitly; you may get 'style.rtl.css' instead of expected pattern.
fix
Always specify the 'filename' option with a pattern that includes the original extension, e.g., '[name].rtl.css'.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'webpack-rtl-plugin'
Package not installed or required incorrectly.
fix
Run 'npm install webpack-rtl-plugin --save-dev' and use 'const WebpackRTLPlugin = require('webpack-rtl-plugin');'
TypeError: WebpackRTLPlugin is not a constructor
Importing as default export incorrectly (e.g., import WebpackRTLPlugin from 'webpack-rtl-plugin') when using ESM.
fix
Use CommonJS require: const WebpackRTLPlugin = require('webpack-rtl-plugin');
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
mini-css-extract-pluginrequiredRequired peer dependency; plugin creates the initial CSS bundle that webpack-rtl-plugin processes into an RTL version
rtlcssrequiredCore dependency used by the plugin to transform CSS from LTR to RTL
Agent activity
6 hits · last 30 days
node
6
Resources
webpack-rtl-plugin — npm install webpack-rtl-plugin · libregistry