Open marcoluzi opened 9 months ago
Yes you're right. I don't know if there was a particular reason we're overwriting those filenames. Also that code is also not great bc it mutates the parameter (which is then only used in another function - so it's very confusing).
cc @fabiankaegy Any thoughts on this? Do you think we could take into account the paths defined in the config for when useBlockAssets
is true?
Hey @nicholasio @fabiankaegy
Hope you are both doing well. Could I have an update on this issue?
Describe your question
Not sure if this is a bug or a feature. I'm trying to implement the [contenthash] into the generated file names. To do that I am using the following settings in the package.json:
This works great for normal scripts and styles, but I do have block specific styles and scripts in the folders
assets/js/blocks
andassets/scss/blocks
. The files in these folders are bundled intodist/blocks
, but the [contenthash] is not applied to the file name. If I do understand the code correctly, this happens because of this section in the code, which changes the filenames, ifuseBlockAssets
is set to true. The filename change happens here.I could change the folder names from
blocks
to something else, but I would like to keep the folder structure and naming convention.My goal is to have the
/assets/js/blocks/[name].js
files to be bundled into/dist/blocks/[name].[contenthash].js
or/dist/js/[name].[contenthash].js
or something like that. The same applies to the scss files. How could i achieve this?package.json:
Currently generated dist:
And thanks for your awesome tool. :)
Code of Conduct