While working on #969, I've found that the Encore.enableIntegrityHashes() feature was doing nothing, because my Encore.configureFilenames() configuration:
The next line fs.existsSync(filePath) can only returns false, because it will try to find a file explicitly named app.js?v=3af532f5, which... does not exist. But app.js file does exist!
If I remove my custom filenames formats, as expected I can see the integrity hashes in entrypoints.json file.
What should we do?
Should we check if ? is present in the filename, and if yes, remove ? and everything after?
Should we keep the actual behavior but log a warning instead?
While working on #969, I've found that the
Encore.enableIntegrityHashes()
feature was doing nothing, because myEncore.configureFilenames()
configuration:Using a query-parameter to store
contenthash
instead of the filename itself, is a strategy mentioned in https://github.com/symfony/webpack-encore/issues/1266.If I had
console.log({outputPath: webpackConfig.outputPath, file, publicPath, filePath })
below lines https://github.com/symfony/webpack-encore/blob/main/lib/plugins/entry-files-manifest.js#L55-L58, it outputs:The next line
fs.existsSync(filePath)
can only returns false, because it will try to find a file explicitly namedapp.js?v=3af532f5
, which... does not exist. Butapp.js
file does exist!If I remove my custom filenames formats, as expected I can see the integrity hashes in
entrypoints.json
file.What should we do?
Should we check if
?
is present in the filename, and if yes, remove?
and everything after? Should we keep the actual behavior but log a warning instead?