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

chore(es-modules): fix usage of require #1663

Closed
wants to merge 1 commit into from
Closed

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented May 9, 2017

Fixes #1238.
Replaces #1237.


What it does?

Stipes our debug functionality to debug.cjs and debug.es files, who use require and import to fetch debug module. Plugin for babel replaces import of module when build is for ES modules. This will fix our ES build for rollup and will left everything as is.

@levithomason I will be glad to hear your opinion there.

@codecov-io
Copy link

codecov-io commented May 9, 2017

Codecov Report

Merging #1663 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1663   +/-   ##
=======================================
  Coverage   99.75%   99.75%           
=======================================
  Files         141      141           
  Lines        2406     2406           
=======================================
  Hits         2400     2400           
  Misses          6        6

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 444fcef...f2f15ab. Read the comment docs.

@levithomason
Copy link
Member

Though this fixes the issue, it adds quite a bit of complexity for one module.

We use the debugger mostly for development on the library itself, I don't think it is used my by others during development. What if we instead just strip these statements entirely from the built version? Perhaps a fork of babel-plugin-transform-remove-console would allow us to do this simply? Possibly also babel-plugin-remove-code could offer some tips.

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

Successfully merging this pull request may close these issues.

Using rollup.js for web builds instead of webpack has unexpected results.
3 participants