Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] ES modules#137

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
goto-bus-stop wants to merge9 commits intomaster
base:master
Choose a base branch
Loading
fromesm
Open

[WIP] ES modules#137

goto-bus-stop wants to merge9 commits intomasterfromesm

Conversation

goto-bus-stop
Copy link
Member

Adds node-style experimental ES modules support. passesm: true to interpret.mjs files as ES modules.

ES modules get arec.esm property so that later parts in the browserify pipeline can identify them.rec.esm is an object containing properties:

  • rec.esm.imports - array of imported bindings
  • rec.esm.exports - array of exported bindings

Imported bindings are objects of the form:

  • binding.from - source module (value"a" inimport "a")
  • binding.import - imported binding
  • binding.as - local name for the binding (often the same asbinding.import)
  • binding.esm - true if the source module is also an ES module, false if it is a commonjs module.

Exported bindings are objects of the form:

  • binding.export - local name of the binding (can be undefined ifexport default-ing an unnamed expression)
  • binding.as - public name of the binding

Transforms can checkopts._flags.esm to see if the module being transformed is an ES module (true) or a CommonJS module (false). It might be useful if transforms could alsosetopts._flags.esm to mark theiroutput as an ES module, for languages that compile to ES modules.

kumavis reacted with heart emoji
@arlac77
Copy link
Contributor

@goto-bus-stop any plans to continue on this PR ?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@goto-bus-stop@arlac77

[8]ページ先頭

©2009-2025 Movatter.jp