Skip to content

Add module field to package.json#49

Merged
rwjblue merged 1 commit intoemberjs:masterfrom
aduth:add/package-json-module
Aug 4, 2017
Merged

Add module field to package.json#49
rwjblue merged 1 commit intoemberjs:masterfrom
aduth:add/package-json-module

Conversation

@aduth
Copy link
Copy Markdown
Contributor

@aduth aduth commented Aug 4, 2017

This pull request seeks to add a module field to the package.json, to allow automatic detection and ES2015 module resolution by Webpack 2+ and Rollup:

It's possible to configure either to pick up the existing jsnext:main, but (a) it'd be nice to be picked up by default without additional configuration and (b) in my experience libraries which opt in to jsnext:main don't always transpile, so requires further configuration to apply Babel (and the right Babel configuration) to node_modules. Since it appears that the dist/es6 is already transpiled save ES2015 modules (sorry, not very familiar with TypeScript nor Ember CLI), this should work fine as-is.

@aduth
Copy link
Copy Markdown
Contributor Author

aduth commented Aug 4, 2017

Might also be interesting to investigate pure-module, which... is new for Webpack (at least to be a documented example)? Apparently helps achieve the tree-shake dream:

https://github.com/webpack/webpack/tree/feature/pure-module/examples/pure-module
https://twitter.com/i/web/status/893109185264500737

I'm not very familiar with it yet.

@rwjblue
Copy link
Copy Markdown
Member

rwjblue commented Aug 4, 2017

Thanks! This seems good to me...

@rwjblue rwjblue merged commit f8bd1b1 into emberjs:master Aug 4, 2017
@aduth aduth deleted the add/package-json-module branch August 4, 2017 17:18
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.

2 participants