Registry / devops / rtlcss-webpack-plugin

rtlcss-webpack-plugin

JSON →
library4.0.7jsnpmunverified

Webpack plugin that creates a second CSS bundle processed for right-to-left (RTL) scripts, using rtlcss under the hood. Version 4.0.7 is the latest stable release. It works alongside extract-text-webpack-plugin or mini-css-extract-plugin to generate a parallel RTL stylesheet (e.g., style.rtl.css). Unlike webpack-rtl-plugin, this plugin is specifically designed for Webpack 4 and requires ExtractTextPlugin or equivalent. Maintenance is minimal, with no updates since 2020.

npm install rtlcss-webpack-plugin
INSTALL
IMPORT
SIG · RTLCSS-WEBPACK-PLU
R
rtlcss-webpack-plugin
devopsjavascriptv4.0.7
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

RtlCssPlugin
import RtlCssPlugin from 'rtlcss-webpack-plugin'
const RtlCssPlugin = require('rtlcss-webpack-plugin')
Default export is the plugin class. CJS require works in Node but TypeScript may need esModuleInterop.
type RtlCssPluginOptions
import type { RtlCssPluginOptions } from 'rtlcss-webpack-plugin'
import { RtlCssPluginOptions } from 'rtlcss-webpack-plugin'
Options type is exported as named type. Do not import as value.
All exports
import RtlCssPlugin from 'rtlcss-webpack-plugin'
import * as RtlCssPlugin from 'rtlcss-webpack-plugin'
Namespace import will not work because the package has a default export only.

Creates two CSS bundles: one LTR (style.css) and one RTL (style.rtl.css) using MiniCssExtractPlugin and rtlcss-webpack-plugin.

const path = require('path'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const RtlCssPlugin = require('rtlcss-webpack-plugin'); 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 RtlCssPlugin({ filename: 'style.rtl.css' }) ] };
Debug
Known issues
breakingVersion 4.0.0 changed from using extract-text-webpack-plugin to requiring mini-css-extract-plugin or extract-text-webpack-plugin v4.
fix
Use MiniCssExtractPlugin instead of ExtractTextPlugin if on Webpack 4+/5.
affects: >=4.0.0
gotchaThe plugin must be placed after the CSS extraction plugin in the plugins array; otherwise, the RTL file may not be generated.
fix
Ensure new RtlCssPlugin(...) appears after MiniCssExtractPlugin or ExtractTextPlugin.
affects: >=1.0.0
deprecatedThe package has not been updated since 2020 and may not support Webpack 5 fully.
fix
Consider using webpack-rtl-plugin for Webpack 5 compatibility.
affects: >=4.0.0
Errors
Common errors & fixes
Error: Cannot find module 'rtlcss-webpack-plugin'
Package not installed or missing in node_modules.
fix
Run npm install rtlcss-webpack-plugin --save-dev
TypeError: RtlCssPlugin is not a constructor
Using namespace import instead of default import.
fix
Use import RtlCssPlugin from 'rtlcss-webpack-plugin'
Error: HookWebpackError: The 'compilation' hook is being tapped by 'RtlCssPlugin' and it is not allowed to be tapped after the 'make' hook.
Plugin is placed before CSS extraction plugin in plugins array.
fix
Move new RtlCssPlugin({...}) after MiniCssExtractPlugin.
Upgrade
Version history
4.0.7latest on npm
Audit
Dependencies
rtlcssrequiredCore CSS transformation library
webpackrequiredPeer dependency for plugin interface
Agent activity
8 hits · last 30 days
node
8
Resources
rtlcss-webpack-plugin — npm install rtlcss-webpack-plugin · libregistry