Vite plugin for rtlcss
$ npm install vite-plugin-rtl-css --save-dev
import { defineConfig } from 'vite';
import viteRtlCssPlugin from 'vite-plugin-rtl-css';
export default defineConfig({
plugins: [viteRtlCssPlugin()]
});
This will transform css files to their rtl counterparts. Look below for options
viteRtlCssPlugin({
fileNameMap: {
'.css': '[name].rtl.css',
'.min.css': '[name].rtl.min.css'
},
sourceMap: true,
rtlcssConfig: {
autoRename: true
}
});
fileNameMap
is an optional parameter that specifies a map of file extensions to templates for rtl css generation. What's seen in the example is the default.sourceMap
is an optional parameter that specifies if sourcemaps should be generated. If this isn't specified it'll default tobuild.sourcemap
from yourvite.config.ts
.rtlcssConfig
is an optional parameter that comes from thertlcss
package that's used by this plugin to configurertlcss
.