-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Providing ES2015 builds #45
Comments
Thanks for the issue! I left my comment in #46, but I currently don't see the reason to include these changes. Can you provide more information on why it'd be valuable to add these complications to the build instead of just staying CommonJS? As far as I understand, there's no real chance to save any build size from using ES6 modules. If the changes are accepted, does this create the possibility of fragmentation - e.g. if someone uses deep requires. Also, I'd prefer to build as little as possible - so only one set of |
Hello @blakeembrey, per your request on the PR: I'd like to see this happen, as it allows for ES6-aware bundlers, such as rollup, to perform tree-shaking on unused parts of the library. As you mention most of the library is probably used at all times, but there is definitely a very large overhead of using commonjs in addition to ES2015 modules when bundling. Also, it limits the ability for libraries, such as TypeStyle, to provide ES2015 builds where it is definitely possible to have large unused parts of the library. I myself have ~95% of my dependencies providing ES2015 builds, and using TypeStyle (I've also opened an issue and PR for ES2015 modules for TypeStyle BTW) in conjunction with this library limits the tooling I'm able to use because of the need to support commonjs. In other words, I've been "forced" to use webpack in order to support commonjs when I much prefer rollup. The next benefit I see is that it provides a build that is based on an ECMAScript standard.
Fair enough, I could update the PR I submitted to not build declaration files and to use the |
Hello, first off thank you for the wonderful work here. I've been enjoying this library indirectly through TypeStyle.
Recently I've been trying to update all of my dependencies to provide ES2015 builds and TypeStyle and FreeStyle remains one of the last of them which are commonjs only.
I'd love to create a PR, but didn't want to do so without getting feedback on if it would be accepted. Typically I've created 2 separate tsconfigs,
tsconfig-es2015.json
and the "standard"tsconfig.json
looking something like theseThen in the libraries
package.json
changing or adding the following fieldsThanks for your time!
The text was updated successfully, but these errors were encountered: