Skip to content

do not limit to js or ts files #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
shlomiassaf opened this issue Jan 25, 2018 · 2 comments
Open

do not limit to js or ts files #3

shlomiassaf opened this issue Jan 25, 2018 · 2 comments

Comments

@shlomiassaf
Copy link

shlomiassaf commented Jan 25, 2018

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... :)

@cvle
Copy link
Contributor

cvle commented Jan 29, 2018

@shlomiassaf I think it is meant to check whether or not this is executable code. In this case execute it, otherwise give me the raw content (e.g. css files).

@shlomiassaf
Copy link
Author

I understand that, but it still makes the loader unusable when you have other extensions that are JS executable...

tsx is one example, there are others.

You should al least let people choose the extensions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants