-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
babel-register compiles .js files; should only handle .babel.js #39
Comments
That's super cool but it didn't exist when we implemented this. This addition should be fine as older versions should ignore that extra property (people might still encounter a problem with older versions). |
@phated this will break my codebase because we use a mix of ".js" and ".es" files. Maybe interpret should read settings from ".interpret.json" or "package.json#interpret" |
@graingert: How will this break your code, since js-interpret doesn't do anything for |
@graingert We won't be adding anything like an |
I'm using both .js and .es files I expect them both to be transpiled
|
Right, but js-interpret specifically does not transpile |
yeah I get that, but once the first module loads all the ".js" files are also transpiled. Which is a step forward. |
...but I think your use case it in conflict with js-interpret's intended behavior. On Tue, Jun 28, 2016 at 11:49 AM, Thomas Grainger notifications@github.com
|
Yeah I want ".es" and ".js". Without this change, interpret is half-way there. And I currently depend on that feature. |
@graingert This module is primarily used to support writing cli tool configuration files in any format transparently. What is the use case where you have, for example, a gulpfile with two different extensions? |
I need to require my webpack config in my backend codebase (enhanced require etc). I have a mix of legacy ES5 code and ES2016 code that need to be linted differently. JSCS does not support distinguishing of files like .babel.js and .js, they both have the same extension. So I use a mix of .js and .es files, and I configure two JSCS and eslint configs, one that points at .js the other at .es. |
@graingert we aren't going to support the .es extensions because it was thoroughly discussed in the gulp issue gulpjs/gulp#830 |
Babel frequently has bugs (at least, I've hit many) so there's no reason to have babel compiling
.js
files when it's not necessary.You can use babel-register's
only
option to avoid transpiling files unless they actually end in.babel.js
https://github.com/js-cli/js-interpret/blob/master/index.js#L2-L12
The text was updated successfully, but these errors were encountered: