Skip to content
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

Browserify always prefers .js and .json over custom extensions #1747

Open
MatejKafka opened this issue Jul 13, 2017 · 1 comment
Open

Browserify always prefers .js and .json over custom extensions #1747

MatejKafka opened this issue Jul 13, 2017 · 1 comment

Comments

@MatejKafka
Copy link

When building my project, I use browserify with coffeeify and I set extensions: ['.coffee'] in configuration. I also have automatic coffeescript compiler running in my IDE to quickly see how the compiled code for a file looks. I don't use extensions in my require calls.

Problem is, when compiling, browserify prefers the already compiled .js files over the source .coffee files, which breaks the generated source map (it maps to the .js files instead of the real source).

In index.js of browserify on line 433, extensions are added in the following way:
mopts.extensions = [ '.js', '.json' ].concat(mopts.extensions || []);

I suggest reversing the operation and appending .js and .json to the end, so it gives precedence to custom extensions.

@jaeschliman
Copy link

This is addressed in PR #1736

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

No branches or pull requests

2 participants