-
-
Notifications
You must be signed in to change notification settings - Fork 201
Always add a hash to the name of the files created by the default assets loaders #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
lib/config-generator.js
Outdated
@@ -127,15 +127,15 @@ class ConfigGenerator { | |||
test: /\.(png|jpg|jpeg|gif|ico|svg)$/, | |||
loader: 'file-loader', | |||
options: { | |||
name: `images/[name]${this.webpackConfig.useVersioning ? '.[hash]' : ''}.[ext]`, | |||
name: 'images/[name].[hash].[ext]', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about using a shorter hash - like [hash:8]
? The longer seems overkill... I should have done this originally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, no idea what's up with AppVeyor though (same thing for #103)
One minor comment - but this looks great - really nice job with the test! |
Thank you @Lyrkan! Test failure is from master and unrelated - I'll fix it :) |
…fault assets loaders (Lyrkan) This PR was squashed before being merged into the master branch (closes #110). Discussion ---------- Always add a hash to the name of the files created by the default assets loaders This PR modifies the configuration of the default assets loaders so a `[hash]` is always added to the output file names, even if versioning is disabled. It basically prevents having two files with the same name (but in a different directory) overwriting each other during build. This closes #73 and was further discussed in #103. Commits ------- d5cd482 Use [hash:8] for images and fonts filenames instead of [hash] 874235d Modify images/fonts loaders so a hash is always added to the name of output files
…n (bobdenotter) This PR was merged into the master branch. Discussion ---------- Updating Yarn dependencies, making build process work again Some housekeeping on the Yarn / Encore build process: - Updated `symfony/encore` to `0.20.1` from `0.9.1` - Update a few other deps - Build process is now working again - Changed file naming strategy Note: I replaced this ``` .enableVersioning(false) ``` with this: ``` .configureFilenames({ js: '[name].js', images: 'images/[name].[ext]', fonts: 'fonts/[name].[ext]' }) ``` I did this to keep the delta minimal. Since symfony/webpack-encore#110 `.enableVersioning(false)` is not doing what it says (for understandable reasons), but in this case I chose to keep the filenames without a versioning hash. If you think we should introduce filenames with version hashes instead, i'll happily update this PR. Commits ------- 44d7267 Updating Yarn dependencies, making build process work again
…n (bobdenotter) This PR was merged into the master branch. Discussion ---------- Updating Yarn dependencies, making build process work again Some housekeeping on the Yarn / Encore build process: - Updated `symfony/encore` to `0.20.1` from `0.9.1` - Update a few other deps - Build process is now working again - Changed file naming strategy Note: I replaced this ``` .enableVersioning(false) ``` with this: ``` .configureFilenames({ js: '[name].js', images: 'images/[name].[ext]', fonts: 'fonts/[name].[ext]' }) ``` I did this to keep the delta minimal. Since symfony/webpack-encore#110 `.enableVersioning(false)` is not doing what it says (for understandable reasons), but in this case I chose to keep the filenames without a versioning hash. If you think we should introduce filenames with version hashes instead, i'll happily update this PR. Commits ------- 44d7267 Updating Yarn dependencies, making build process work again
…n (bobdenotter) This PR was merged into the master branch. Discussion ---------- Updating Yarn dependencies, making build process work again Some housekeeping on the Yarn / Encore build process: - Updated `symfony/encore` to `0.20.1` from `0.9.1` - Update a few other deps - Build process is now working again - Changed file naming strategy Note: I replaced this ``` .enableVersioning(false) ``` with this: ``` .configureFilenames({ js: '[name].js', images: 'images/[name].[ext]', fonts: 'fonts/[name].[ext]' }) ``` I did this to keep the delta minimal. Since symfony/webpack-encore#110 `.enableVersioning(false)` is not doing what it says (for understandable reasons), but in this case I chose to keep the filenames without a versioning hash. If you think we should introduce filenames with version hashes instead, i'll happily update this PR. Commits ------- 44d7267 Updating Yarn dependencies, making build process work again
This PR modifies the configuration of the default assets loaders so a
[hash]
is always added to the output file names, even if versioning is disabled.It basically prevents having two files with the same name (but in a different directory) overwriting each other during build.
This closes #73 and was further discussed in #103.