create-react-app: Treat all unknown extensions as resources
I’m getting a bit tired of extending our whitelist like in #665.
I think we should have a “catch all” loader that uses file-loader
for any unknown extensions.
This makes sense because it’s easy to explain: “if you import something that isn’t JS or CSS, it becomes a part of the build, you get its filename, and can do whatever with it”.
I think @dralletje planned to look into this.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 23
- Comments: 22 (20 by maintainers)
Looking at webpack.config.dev.js, I’m wondering: why use url-loader for audio / video, but file-loader for images? In the scenarios I’m most familiar with, you’d usually do the complete opposite of that: you want essential images, like sprite sheets, to load immediately, but sound and video can wait.
I think this using file-loader for unknown resources is a good default.