-
-
Notifications
You must be signed in to change notification settings - Fork 158
fix(utils/normalizeFallback): fallback options behaviour (options.fallback
)
#145
Conversation
08a7a59
to
4858119
Compare
exports[`fallback option {String} (with query) 1`] = `"module.exports={\\"limit\\":-9007199254740991,\\"name\\":\\"fallback-[hash].[ext]\\",\\"unknown\\":\\"fallback-value\\"}"`; | ||
|
||
exports[`fallback option {String} 1`] = `"module.exports={\\"limit\\":-9007199254740991,\\"name\\":\\"[name].[hash].[ext]\\",\\"unknown\\":\\"value\\"}"`; | ||
|
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 we do:
- Get original options from
url-loader
. - Get fallback options.
- Merge their :
options = Object.assign({}, originalOptions, fallbackOptions);
. - delete
options.fallback
.
options.fallback
)
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.
👍
return normalizeFallbackString('file-loader', originalOptions); | ||
if (index >= 0) { | ||
loader = fallback.substr(0, index); | ||
options = loaderUtils.parseQuery(fallback.substr(index)); |
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.
parseQuery
👍
options.fallback
)options.fallback
)
@michael-ciniawsky I think pass all options is the right solution. Also we provide way to rewrite |
Agreed I just thought passing only the custom options defined via |
@michael-ciniawsky let's merge this and release new version |
Released in |
This PR contains a:
Motivation / Use-Case
fixes #144 fixes #146
Breaking Changes
no
Additional Info
Refactor tests + more tests