Skip to content

Commit

Permalink
include hashes in production builds of assets
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Apr 11, 2024
1 parent 6cafc68 commit 97bba88
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,20 @@ const coreConfig = function() {
'webpack/assets/javascripts/bundle.js'
);
config.context = path.resolve(__dirname, '..');
if (config.mode == 'production') {
var jsName = '[name]-[chunkhash].js'
} else {
var jsName = '[name].js'
}
config.entry = {
bundle: { import: bundleEntry, dependOn: 'vendor' },
vendor: vendorEntry,
reactExports: path.join(
__dirname,
'..',
'webpack/assets/javascripts/all_react_app_exports.js'
),
bundle: { import: bundleEntry, dependOn: 'vendor', filename: jsName },
vendor: { import: vendorEntry, filename: jsName },
reactExports: { import: path.join(
__dirname,
'..',
'webpack/assets/javascripts/all_react_app_exports.js'
), filename: jsName
},
};
config.output = {
path: path.join(__dirname, '..', 'public', 'webpack'),
Expand Down

0 comments on commit 97bba88

Please sign in to comment.