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
muslnode 18–226 runs
build_error
glibcnode 18–226 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' })
]
};
Errors
Common errors & fixes
Error: Cannot find module 'rtlcss-webpack-plugin'
Package not installed or missing in node_modules.
fixRun npm install rtlcss-webpack-plugin --save-dev
TypeError: RtlCssPlugin is not a constructor
Using namespace import instead of default import.
fixUse 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.
fixMove new RtlCssPlugin({...}) after MiniCssExtractPlugin. Audit
Dependencies
rtlcssrequiredCore CSS transformation library
webpackrequiredPeer dependency for plugin interface