Closed
Description
If you are using the [contenthash]
as a query string, the integrity hashes are not generated.
Example webpack.config.js
const Encore = require('@symfony/webpack-encore');
Encore
// directory where compiled assets will be stored
.setOutputPath('build/')
// public path used by the web server to access the output path
.setPublicPath('/build/')
.setManifestKeyPrefix('build/')
// hash as querystring instead of in filename
.configureFilenames({
js: '[name].js?[contenthash]',
})
.addEntry('example', './src/example.js')
.disableSingleRuntimeChunk()
.enableVersioning(Encore.isProduction())
.enableIntegrityHashes(Encore.isProduction())
;
module.exports = Encore.getWebpackConfig();
Generated entrypoints.json
{
"entrypoints": {
"example": {
"js": [
"/static/build/example.js?621df54d056c27d5eaa8"
]
}
},
"integrity": {}
}
The problem exists, because entry-files-manifest.js
assumes the filename is a a valid file:
webpack-encore/lib/plugins/entry-files-manifest.js
Lines 52 to 57 in 6b75c4d
If the query string would be stripped, the file path should be correct.
Metadata
Metadata
Assignees
Labels
No labels