tv-rtl-webpack-plugin
v1.6.2
Published
Webpack plugin to produce a rtl css bundle
Downloads
4
Readme
Webpack RTL Plugin (optimized version)
Webpack plugin to use in addition to extract-text-webpack-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.
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 webpack-rtl-plugin
Usage
Add the plugin to your webpack configuration:
import WebpackRTLPlugin from 'webpack-rtl-plugin'
module.exports = {
entry: path.join(__dirname, 'src/index.js'),
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
},
module: {
loaders: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader'),
}
],
},
plugins: [
new ExtractTextPlugin('style.css'),
new WebpackRTLPlugin(),
],
}
This will create the normal style.css
and an additionnal style.rtl.css
.
Options
new WebpackRTLPlugin({
filename: 'style.[contenthash].rtl.css',
options: {},
plugins: [],
diffOnly: false,
minify: true,
})
filename
the filename of the result file. May contain[contenthash]
. Default tostyle.css
.[contenthash]
a hash of the content of the extracted file
options
Options given tortlcss
. See the rtlcss documentation for available options.plugins
RTLCSS plugins given tortlcss
. See the rtlcss documentation for writing plugins. Default to[]
.diffOnly
If set totrue
, the stylesheet created will only contain the css that differs from the source stylesheet. Default tofalse
.minify
will minify the css. You can also pass an object for the arguments passed tocssnano
. Default totrue
.