Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

ignore requires in dead branches #93

Closed
Rich-Harris opened this issue Aug 31, 2016 · 0 comments
Closed

ignore requires in dead branches #93

Rich-Harris opened this issue Aug 31, 2016 · 0 comments

Comments

@Rich-Harris
Copy link
Contributor

Via rollup/rollup#855 (comment):

if (process.env.NODE_ENV !== 'production') {
  var ReactElementValidator = require('./ReactElementValidator');
  createElement = ReactElementValidator.createElement;
  createFactory = ReactElementValidator.createFactory;
  cloneElement = ReactElementValidator.cloneElement;
}

If process.env.NODE_ENV has been rewritten as 'production' (i.e. this plugin follows rollup-plugin-replace), we should disregard the require('./ReactElementValidator').

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

No branches or pull requests

1 participant