-
-
Notifications
You must be signed in to change notification settings - Fork 158
refactor(index): remove unnecessary delete #140
Conversation
@michael-ciniawsky don't merge before @insin until it tested |
@michael-ciniawsky looks we do breaking change here https://github.com/webpack-contrib/url-loader/blob/master/src/utils/normalizeFallback.js#L15 we don't pass We should pass all option(s) from url-loader to fallback loader or add |
Can't we just accept an {
...
use: {
loader: 'url-loader',
options: {
fallback: {
loader: 'responsive-loader',
options: { ... } // We only pass these to the custom fallback
}
}
}
} and for the default ( |
Good idea, let' do it, if no options defined we use url-options. Should options inherit? I.e. if i defined name for url loader, should we pass name to fallback? I think yes |
We can do that yes, but I think we should 'cherrypick'/limit them to only the useful/required ones (e.g
|
if that works (didn't tried/tested yet :)) |
@michael-ciniawsky what about
We should always pass all options, but fallback options always rewrite |
Wouldn't that mean to just use {
loader: 'url-loader'
options: {
name: '[name].[ext]',
fallback: 'x-loader',
'x-option1': '',
'x-option2': ''
}
} |
@michael-ciniawsky yep, just merge options: |
Yes, but if the custom fallback loader options are declared on the |
@michael-ciniawsky for backwards compatibility since we in previous versions sent all the options, we can add comments about remove this in |
What do you mean by removing this (?) in version 2.0.0 :). I'm a bit confused by the
{
loader; 'url-loader',
options: {
limit: 1,
name: '',
fallback: 'x-loader',
any: '',
option: '',
you: '',
want: '',
}
} like it was before, but there must be a reason why |
@michael-ciniawsky i will send new PR and we continue the discusion in it, this PR we can merge |
Does #139 💯 fixed it for now ? I can open an issue and we can discuss separately since people seem to have quite some issues with we better release a patch asap :) |
:D you're faster, yep agreed 👍 |
This PR contains a:
Motivation / Use-Case
we don't support webpack@3 in this package
Breaking Changes
no
Additional Info
delete is very expensive operation (perf)
/cc @insin can you test this branch to avoid we fix problem #138