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

Add "module" index for systems that can consume ES modules. #18

Merged
merged 1 commit into from
Jan 9, 2018

Conversation

cowboyd
Copy link
Member

@cowboyd cowboyd commented Jan 9, 2018

The @bigtest/mocha JavaScript sources are written using ES modules, but not every system that will be consuming @bigtest/mocha understands them. For those systems (specifically Node runtimes), we build an AMD equivalent using rollup.js and put the index for it in dist/index.js. On the other hand, if your system understands modules (like a webpack or a broccoli build) then you want to skip the intermediary build and just use the native sources directly.

We can tell systems where the ES module representing the entry point is, by using the "module" property and pointing it to the primary module for our library.

The @bigtest/mocha JavaScript sources are written using ES modules,
but not every system that will be consuming @bigtest/mocha understands
them. For those systems (specifically Node runtimes), we build an AMD
equivalent using rollup.js and put the index for it in
`dist/index.js`. On the other hand, if your system understands
modules (like a webpack or a broccoli build) then you want to skip the
intermediary build and just use the native sources directly.

We can tell systems where the ES module representing the entry point
is, by using the "module" property and pointing it to the primary
module for our library.
Copy link
Contributor

@Robdel12 Robdel12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Nice!

@cowboyd cowboyd merged commit 952cb49 into master Jan 9, 2018
@cowboyd cowboyd deleted the cl/es-module-compatible branch January 9, 2018 21:09
cowboyd pushed a commit that referenced this pull request Feb 20, 2020
Add some really basic code for websocket connection from agent
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

Successfully merging this pull request may close these issues.

None yet

2 participants