You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The create-react-app webpack config has configured their loaders to use rule.oneOf to see if a file matches one of the specific loaders configured, and if not, use the generic file-loader.
I'm not certain how useful this is though as webpack will still yell at you if you try to import something that it doesn't know how to handle more often than not.
Doing some digging through CRA's history it looks like they came to the conclusion that a default file-loader was beneficial because of the scope they were trying to handle. Many people were trying to load many file types that were unorthodox. Edge cases were easier to solve all at once with a catchall loader than on a case-by-case basis (CRA is supposed to be zero-configuration).
For our purposes, I think us leaving webpack to error out if a project starts dealing with a different kind of file is sufficient.
At the same time, It's not like having a catchall file-loader rule will hurt anything. It's already a dependency.
The create-react-app webpack config has configured their loaders to use rule.oneOf to see if a file matches one of the specific loaders configured, and if not, use the generic file-loader.
I'm not certain how useful this is though as webpack will still yell at you if you try to import something that it doesn't know how to handle more often than not.
Thoughts?
Create React App's config:
https://github.com/facebook/create-react-app/blob/next/packages/react-scripts/config/webpack.config.dev.js#L166
The text was updated successfully, but these errors were encountered: