Feature request
from facebook/create-react-app#667 (comment):
A catchall unknown-source loader feels like it would be pretty beneficial.
My opinion is that you want it managed by webpack in some way or another.
What is the expected behavior?
Non-javascript files without loader will be handled by file-loader
, this can be configured in module.fallbackLoader
.
What is motivation or use case for adding/changing the behavior?
Nowadays you need to list all of extensions yourself:
{
test: /\.(json|css|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$/,
loader: "file-loader",
}
How should this be implemented in your opinion?
// webpack.config.js
module.exports = {
module: {
fallbackLoader: {
loader: "url-loader",
}
}
}
Are you willing to work on this yourself?
yes
While I think it makes more sense to list all extensions explicitly you can do a
default
loaders with theoneOf
construct inmodule.rules
:https://webpack.js.org/configuration/module/#rule-oneof
make sense, now it works, that solves problem for me, thanks for help, final config:
Webpack block