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

Chrome 61 now supports ES6 Modules by default #2141

Open
codedread opened this issue Oct 11, 2017 · 2 comments
Open

Chrome 61 now supports ES6 Modules by default #2141

codedread opened this issue Oct 11, 2017 · 2 comments

Comments

@codedread
Copy link
Member

When Chrome 61 sees a <script type="module"...> tag, it will interpret is as an ES6 module. Is there any way to detect this at run-time to prevent Traceur doing transpilation when we don't need it to?

@codedread
Copy link
Member Author

codedread commented Oct 12, 2017

I learned about nomodule, which is going to work for me. However, I am now noticing that the browsers match import paths differently than Traceur:

lib/foo.js:
import { Bar } from 'bar.js';

Traceur looks for the import at /bar.js.
Chrome and Firefox look for the import at /lib/bar.js.

If I could configure WebPageTranscoder with a base URL, this would probably fix things...

@arv
Copy link
Collaborator

arv commented Oct 13, 2017

Neither is right. For import statements you need to do './bar.js'.

For the other issue, checking for a noModule property descriptor on the HTMLScriptElement.prototype seems like the right approach. Care to send a PR?

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