-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
Feature: add compiler output options support for hash #120
base: master
Are you sure you want to change the base?
Feature: add compiler output options support for hash #120
Conversation
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.
We need implement api for hash*
options for loader api, feel free to open issue or better send a PR
@@ -64,12 +64,18 @@ function interpolateName(loaderContext, name, options) { | |||
} | |||
} | |||
let url = filename; | |||
const compilationOutputOptions = loaderContext._compilation && loaderContext._compilation.outputOptions || {}; |
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.
It is private properties and don't use their, you need open issue in webpack with feature request provide this option throw api
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.
@evilebottnawi thanks, i will do it
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.
@aarefiev good news, thanks for helping
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.
@aarefiev can you create issue so that we don't lose this problem if it require time?
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.
@evilebottnawi done (#121)
Good day, guys!
Yesterday I worked on configuring webpack for my own project and I found that I can't use the same output filename settings for all loaders. Especially, for file-loader.
Here is the part of webpack.config.js:
After compilation I found that the hash part of name of extracted css and bundled files are truncated, but all other assets that I uploaded as is with file-loader are not truncated. As solution, I should pass
maxLength
tooptions.name
(in format[name].[hash:8].[ext]
) and it will work as I expected.I think it is not good because I should pass the same settings for each loader, maybe is better to support compiler settings as it support MiniCssExtractPlugin.
What you think about it?