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 ES Modules #503

Open
anthony-redFox opened this issue Mar 5, 2018 · 3 comments
Open

Support ES Modules #503

anthony-redFox opened this issue Mar 5, 2018 · 3 comments

Comments

@anthony-redFox
Copy link
Contributor

It was broken in version 2.5.2.

@bradrydzewski
Copy link

apologies for what amounts to a +1 comment, but wondering if support for es modules could be added for the package. With major browsers supporting imports and tooling like pikapkg having an es module would be very useful :)

@Yomguithereal
Copy link
Owner

If you can find a non-breaking way to support this I would of course be willing to review a PR on the matter. Would this just amount to adding some config keys to package.json?

@bradrydzewski
Copy link

bradrydzewski commented Apr 16, 2019

I have only ever done this with rollup, but you need to generate your distribution in iife format, and then in your package.json you include the path to this file in the module section.

"module": "build/module/index.js"

What are you currently using to build your distribution? I can try to integrate into your existing build process. Or if you are open to some additional tooling I can submit a rollup file and include a build command in the package.json to generate the iife module.

jacomyal added a commit to jacomyal/baobab that referenced this issue Feb 18, 2020
Details:
- Modernizes exports from src/baobab.js (might solve Yomguithereal#503)
- Adds src/baobab.d.ts
- Renames all JS test files as .TS
- Fixes new TypeScript issues in test files
- Copies src/baobab.d.ts to dist on `npm run dist`
jacomyal added a commit to jacomyal/baobab that referenced this issue Feb 18, 2020
Details:
- Modernizes exports from src/baobab.js (might solve Yomguithereal#503)
- Adds src/baobab.d.ts
- Renames all JS test files as .TS
- Fixes new TypeScript issues in test files
- Copies src/baobab.d.ts to dist on `npm run dist`
jacomyal added a commit to jacomyal/baobab that referenced this issue Feb 18, 2020
Details:
- Modernizes exports from src/baobab.js (might solve Yomguithereal#503)
- Adds src/baobab.d.ts
- Renames all JS test files as .TS
- Fixes new TypeScript issues in test files
- Copies src/baobab.d.ts to dist on `npm run dist`
jacomyal added a commit to jacomyal/baobab that referenced this issue Feb 18, 2020
Details:
- Modernizes exports from src/baobab.js (might solve Yomguithereal#503)
- Adds src/baobab.d.ts
- Renames all JS test files as .TS
- Fixes new TypeScript issues in test files
- Copies src/baobab.d.ts to dist on `npm run dist`
- Updates emmett to 3.2.0 to get proper types
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

3 participants