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

Support import in scripts #155

Open
dy opened this issue Jun 18, 2020 · 2 comments
Open

Support import in scripts #155

dy opened this issue Jun 18, 2020 · 2 comments

Comments

@dy
Copy link

dy commented Jun 18, 2020

Trying to come up with node ES module, working both in browser/node.
It uses import.
cat test.js | browser-run gives

SyntaxError: Unexpected identifier
  at http://localhost:55133/bundle.js:1:8 

Would that be reasonable to detect if input code uses import (see is-module) and include script as <script type="module"></script>?

@juliangruber
Copy link
Owner

We could try that, but I'd rather add a flag instead of detecting the module type, for now at least. Would you be interested in working on a PR for this?

@dy
Copy link
Author

dy commented Jul 1, 2020 via email

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