Skip to content

Use es6 modules to better support users that use tree-shaking bundlers #68

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

Closed
2 tasks done
frederickfogerty opened this issue Jul 9, 2018 · 3 comments
Closed
2 tasks done

Comments

@frederickfogerty
Copy link
Contributor

Before you submit:

Is your feature request related to a problem? Please describe.
From #61

Can you use export in Drift.js? Mixing module formats causes issues when using webpack to convert modules. The old way didn't present an issue when we used Babel, but webpack appears to be more strict. We switched because webpack can "tree shake" unused modules.

Describe the solution you'd like
Use export default rather than module.exports. The problem with changing the usage right now is that it breaks the UMD build for direct browser sourcing (i.e. window.Drift). Another bundler will have to be used, such as Webpack, to support this.

Describe alternatives you've considered

  • Browserify: this tool is currently used but doesn't seem to have a way to support export default in this way.
@fleck
Copy link
Contributor

fleck commented Jul 10, 2018

I'll try to put together an example of using rollup with babel to bundle. Webpack is great for building application bundles, but I like rollup better for libraries.

@frederickfogerty
Copy link
Contributor Author

Hey there @fleck. Can you take a look at #70? I've used Webpack + Closure over there, and would love your feedback.

@frederickfogerty
Copy link
Contributor Author

This was closed in #70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants