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
{{ message }}
Repository navigation
Scripts: Filename changes to main.js when ouput-path parameter is added #34239
changed the title [-]Filename changes to main.js when ouput-path parameter is added[/-][+]Scripts: Filename changes to main.js when ouput-path parameter is added[/+]on Aug 23, 2021
The default entry name in webpack is main, and in the config filename is set to [name].js. You can overwrite the filename config by adding --output-filename.
Activity
[-]Filename changes to main.js when ouput-path parameter is added[/-][+]Scripts: Filename changes to main.js when ouput-path parameter is added[/+]gziolo commentedon Aug 24, 2021
There is a similar issue reported related to how entry points are handled with webpack 5: #34236.
It looks like the following doesn't work anymore with the latest major version of
@wordpress/scripts:walbo commentedon Aug 24, 2021
The default entry name in webpack is
main, and in the config filename is set to[name].js. You can overwrite the filename config by adding--output-filename.gziolo commentedon Aug 25, 2021
@walbo thank you for sharing the example. It partially works with the default webpack config, in the context of blocks:
While it applies changes to the output folder and the JavaScript filename, it doesn't get propagated to CSS chunks.
See my related comment for more details: #34264 (comment).
gziolo commentedon Sep 8, 2021
It looks like #34264 will fix this issue.
gziolo commentedon Sep 9, 2021
There is
@wordpress/scriptsv18.0.1 available with the fix.