Skip to content

Commit

Permalink
Avoid always loading RTL stylesheets (#12552)
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored Oct 27, 2022
1 parent a116381 commit f3f0e9d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ const templateContent = ({ htmlWebpackPlugin, chunkNames }) => {

const chunkName = htmlWebpackPlugin.options.chunks[0];
const omitPrimaryChunk = (f) => f !== chunkName;
const omitRightToLeftChunk = (f) => !f.endsWith('-rtl');

const js = htmlWebpackPlugin.files.js
.map((pathname) => {
Expand All @@ -295,7 +296,8 @@ const templateContent = ({ htmlWebpackPlugin, chunkNames }) => {
const f = filenameOf(pathname);
return f.split('.css')[0];
})
.filter(omitPrimaryChunk);
.filter(omitPrimaryChunk)
.filter(omitRightToLeftChunk);

// We're only interested in chunks from dynamic imports;
// ones that are not already in `js` and not primaries.
Expand Down

0 comments on commit f3f0e9d

Please sign in to comment.