@automattic/webpack-rtl-plugin

6.0.0 • Public • Published

Webpack RTL Plugin

Webpack plugin to use in addition to mini-css-extract-plugin to create a second css bundle, processed to be rtl.

This uses rtlcss under the hood, please refer to its documentation for supported properties.

Originally forked from https://github.com/romainberger/webpack-rtl-plugin, commit aca883ad70671a5d2a90c676fe8ea60d42c8759b (tag v2.0.0).

This plugin contains Automattic changes to the original webpack-rtl-plugin and is released as @automattic/webpack-rtl-plugin.

Check out the webpack-rtl-example to see an example of an app using the rtl-css-loader and webpack-rtl-plugin.

Installation

$ npm install @automattic/webpack-rtl-plugin

Usage

Add the plugin to your webpack configuration:

const WebpackRTLPlugin = require( '@automattic/webpack-rtl-plugin' );

module.exports = {
	entry: path.join( __dirname, 'src/index.js' ),
	output: {
		path: path.resolve( __dirname, 'dist' ),
		filename: 'bundle.js',
	},
	module: {
		rules: [
			{
				test: /\.css$/,
				use: [
					MiniCssExtractPlugin.loader,
					{
						loader: 'css-loader',
						options: {
							/*...,*/
						},
					},
				],
			},
		],
	},
	plugins: [
		new MiniCssExtractPlugin( {
			filename: 'style.css',
		} ),
		new WebpackRTLPlugin(),
	],
};

This will create the normal style.css and an additionnal style.rtl.css.

Options

new WebpackRTLPlugin({
  options: {},
  plugins: [],
})

Readme

Keywords

Package Sidebar

Install

npm i @automattic/webpack-rtl-plugin

Weekly Downloads

1,764

Version

6.0.0

License

GPL-2.0-or-later

Unpacked Size

7.19 kB

Total Files

5

Last publish

Collaborators

  • arthur791004
  • mrmurphy
  • alshakero
  • pyronaur
  • porada
  • imranh920
  • gmjuhasz
  • rcarvalho
  • briowill
  • bgrgicak
  • dhenridev
  • daledupreez-a8c
  • jeherve
  • yuliyan
  • micbosia8c
  • jeremy.yip
  • wpvip-bot
  • etobiesen
  • kzoschke
  • brunobasto
  • kat3samsin
  • fmfernandes
  • newspack
  • robertsreberski_a8c
  • msurdi-a8c
  • chihsuan
  • manzoorwanijk
  • rjchow
  • andrea-sdl
  • scjr
  • spsiddarthan
  • t2dw4t
  • ehg_
  • wwa
  • sirreal
  • elazzabi
  • royho
  • luismulinari
  • macbre
  • mjangda
  • matticbot
  • a8c
  • blowery
  • noahtallen
  • hanifn
  • sgomes
  • tyxla
  • saroshaga
  • parkcityj
  • nejclovrencic
  • sirbrillig
  • chriszarate
  • robersongomes
  • johngodley