You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When extending @wordpress/scripts' webpack.config.js to add to entry using chunk/entry point names containing forward slashes, the style-{chunk name}.css files produced are output to a directory disparate from the rest of the assets and bundles built for that entrypoint.
Step-by-step reproduction instructions
Override @wordpress/scripts' webpack.config.js file to add entrypoints with names including /:
All built chunk bundles and assets are located in the path described by the entry-point name, relative to the output directory. An entry-point named 'blocks/foo/index' should result in src/blocks/foo/style.scss's built asset being output at build/blocks/foo/style-index.css:
Actual behaviour
The respective CSS files end up in a first-level directory separate from all other related assets. An entry-point named 'blocks/foo/index' results in src/blocks/foo/style.scss's built asset being output at build/style-blocks/foo/index.css:
The text was updated successfully, but these errors were encountered:
bosconian-dynamics
changed the title
@wordpress/scripts: FixStyleWebpackPlugin produces output in incorrect locations for path-based chunk names
@wordpress/scripts: style-{chunk name}.css files are output in incorrect locations when using path-based chunk names
Jun 17, 2021
bosconian-dynamics
changed the title
@wordpress/scripts: style-{chunk name}.css files are output in incorrect locations when using path-based chunk names
@wordpress/scripts: webpack splitChunks config incompatible with path-based entry names
Jun 17, 2021
bosconian-dynamics
changed the title
@wordpress/scripts: webpack splitChunks config incompatible with path-based entry names
@wordpress/scripts: path-based webpack entry points produce inconsist output file structure
Jun 17, 2021
As it turns out, this is simply how Webpack v4's splitChunks automatic naming scheme works. It seems it could be overridden by specifying a splitChunks.name property, but the documentation recommends against doing so in production.
It would be nice if FixStyleWebpackPlugin could support such user-supplied splitChunks naming schemes.
…th-based chunk names (#32834)
Changes FixStyleWebpackPlugin's chunk name to file name resolution to
account for entrypoints containing forward slashes in their names,
resulting in the related `style-{chunk name}.css` files being output
within the path described by the chunk name rather than rooted to the
output directory.
Closes#32791.
Description
When extending
@wordpress/scripts
'webpack.config.js
to add toentry
using chunk/entry point names containing forward slashes, thestyle-{chunk name}.css
files produced are output to a directory disparate from the rest of the assets and bundles built for that entrypoint.Step-by-step reproduction instructions
@wordpress/scripts
'webpack.config.js
file to add entrypoints with names including/
:wp-scripts build
orwp-scripts start
.Expected behaviour
All built chunk bundles and assets are located in the path described by the entry-point name, relative to the output directory. An entry-point named
'blocks/foo/index'
should result insrc/blocks/foo/style.scss
's built asset being output atbuild/blocks/foo/style-index.css
:Actual behaviour
The respective CSS files end up in a first-level directory separate from all other related assets. An entry-point named
'blocks/foo/index'
results insrc/blocks/foo/style.scss
's built asset being output atbuild/style-blocks/foo/index.css
:The text was updated successfully, but these errors were encountered: