Created by: Furizaa
This PR uses the oneOf rule to resolve loaders in webpack.config.prod.js
. This will use the first loader that matches in the list of loaders provided by oneOf
and enables us to remove the big exclusion list of the file-loader
. The file loader will only be used if the module falls through all other loaders.
https://webpack.js.org/configuration/module/#rule-oneof
For some reason though I had to still preserve the js(x)
exclusion in the file loader. Otherwise the build would break. This happens with or without the eslint
preloader. Will have to investigate further why exactly this happens and why these unknown js(x)
modules fall through to the file-loader
.
The resolve
now looks something like this (pseudocode):
[
{ 'eslint-loader', enforce: 'pre', test: 'javascript' },
{
oneOf: [
{ 'url-loader': test: 'images' },
{ 'babel-loader', test: 'javascript' },
{ 'style-loader', test: 'style' },
{ 'file-loader' },
]
}
]