-
Notifications
You must be signed in to change notification settings - Fork 8
Description
In this line of code the loader will skip processing if the extensions are not js or ts.
This is not something that the loader should care about.
If the user sent an invalid file, somewhere along the pipeline and error will be thrown and the loader can catch it or pass it on.
The whole purpose of webpack is to allow transformation of content between loaders so it is 100% valid to send a file.XXX that contains valid js code. Even if, originally, the file had C++ code but before value-loader a C++ to JS loader changed it... 100% valid.
A real-life example is tsx files... some might use coffescript files and frankly there are tons of extensions out there that can have valid JS code, transformed or not.
Let this be a user's choice, if the user makes the wrong choice webpack will not stay silent... :)