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 support for ES and browser bundlers #1534

Merged
merged 1 commit into from
Jul 6, 2018

Conversation

eKoopmans
Copy link
Contributor

Summary

This PR implements the following features:

  • Add support for ES and browser bundlers

The main field in package.json points to 'dist/npm/index.js', which is ideal for CommonJS projects, however will fail on ES/browser bundlers because of the use of the undefined process.env.NODE_ENV.

This PR adds the fields module and browser to package.json, as defined here and here (module) and here (browser). Both fields point to dist/html2canvas.js, which is built as UMD and will work with any format.

Test plan (required)

Create a new project, use ES syntax to import html2canvas, and use rollup or similar to bundle into UMD. The term process.env.NODE_ENV will no longer appear in the bundled code using this PR.

Closing issues

No matching issues found.

@niklasvh niklasvh merged commit 41eb8ab into niklasvh:master Jul 6, 2018
@niklasvh
Copy link
Owner

niklasvh commented Jul 6, 2018

Thanks for the PR again!

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