-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Add Encore.configureFilenames() method to the public API #137
Conversation
bacac22
to
0c9a8fe
Compare
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.
This looks awesome! The only change I had was with a small comment... I'll just make that after merging - no sense it not merging due to that :)
* }); | ||
* | ||
* Only the filenames defined in the first parameter | ||
* of this method will be modified. |
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.
How about:
It's safe to omit a key (e.g. css): the default naming strategy
will be used for those file types.
* If you are using Encore.enableVersioning() | ||
* make sure that your "js" filenames contain | ||
* "[chunkhash]" and your "css" filenames contain | ||
* "[contenthash]". |
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.
nice
if (validKeys.indexOf(key) === -1) { | ||
throw new Error(`"${key}" is not a valid key for configureFilenames(). Valid keys: ${validKeys.join(', ')}.`); | ||
} | ||
} |
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.
well, I love this ;)
Thank you @Lyrkan! |
… (Lyrkan) This PR was merged into the master branch. Discussion ---------- Add Encore.configureFilenames() method to the public API This PR adds the `Encore.configureFilenames()` method to the public API (fixes #125). **Example:** ```js Encore.configureFilenames({ js: '[name].[chunkhash].js', css: '[name].[contenthash].css', images: 'images/[name].[hash:8].[ext]', fonts: 'fonts/[name].[hash:8].[ext]' }); ``` If one key is defined in the first parameter it will be used for the filenames of the related category. If it isn't the behavior will stay the same as before. For now I kept the old naming strategies as the default values. We could eventually change that following the discussion in #136. Commits ------- 0c9a8fe Add Encore.configureFilenames() method to the public API
Thank you for your time and the feature @Lyrkan @weaverryan |
This PR adds the
Encore.configureFilenames()
method to the public API (fixes #125).Example:
If one key is defined in the first parameter it will be used for the filenames of the related category.
If it isn't the behavior will stay the same as before.
For now I kept the old naming strategies as the default values. We could eventually change that following the discussion in #136.