Skip to content

Commit

Permalink
Scripts: Add RTLCSS to wp-scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelle committed May 9, 2024
1 parent de09691 commit 51b95a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const browserslist = require( 'browserslist' );
const MiniCSSExtractPlugin = require( 'mini-css-extract-plugin' );
const { basename, dirname, resolve } = require( 'path' );
const ReactRefreshWebpackPlugin = require( '@pmmmwh/react-refresh-webpack-plugin' );
const RtlCssPlugin = require( 'rtlcss-webpack-plugin' );
const TerserPlugin = require( 'terser-webpack-plugin' );
const { realpathSync } = require( 'fs' );
const { sync: glob } = require( 'fast-glob' );
Expand Down Expand Up @@ -382,6 +383,10 @@ const scriptConfig = {
process.env.WP_BUNDLE_ANALYZER && new BundleAnalyzerPlugin(),
// MiniCSSExtractPlugin to extract the CSS thats gets imported into JavaScript.
new MiniCSSExtractPlugin( { filename: '[name].css' } ),
// RtlCssPlugin to generate RTL CSS files.
new RtlCssPlugin( {
filename: `[name]-rtl.css`,
} ),
// React Fast Refresh.
hasReactFastRefresh && new ReactRefreshWebpackPlugin(),
// WP_NO_EXTERNALS global variable controls whether scripts' assets get
Expand Down
1 change: 1 addition & 0 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"react-refresh": "^0.14.0",
"read-pkg-up": "^7.0.1",
"resolve-bin": "^0.4.0",
"rtlcss-webpack-plugin": "4.0.7",
"sass": "^1.35.2",
"sass-loader": "^12.1.0",
"source-map-loader": "^3.0.0",
Expand Down

0 comments on commit 51b95a3

Please sign in to comment.