-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
Replace env with production to fix umd crashing in runtime #637
Conversation
Codecov Report
@@ Coverage Diff @@
## master #637 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 15 15
Lines 621 618 -3
Branches 133 133
=====================================
- Hits 621 618 -3
Continue to review full report at Codecov.
|
@gpbl Are you okay with this PR? |
Ping? Currently umd is broken. |
Yeah this should work now. I guess all these complications were made (by me) because I didn't want to include the moment.js package. |
@@ -29,6 +31,11 @@ module.exports = { | |||
}, | |||
], | |||
}, | |||
plugins: [ | |||
new webpack.DefinePlugin({ | |||
'process.env.NODE_ENV': JSON.stringify('production') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in development this plugin should not be here. Dunno gotta merge it and see how it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UMD should not require build step, since it can be used in browsers. So NODE_ENV
should be either production
or development
. Currently webpack adds process polyfill which sets NODE_ENV
as undefined
, so it's not production
. But you excluded prop-types
from umd and prop-types
definitions are fails in runtime.
Published as v7.1.0. |
Replace env with production to fix umd crashing in runtime
Ref #632
Currently umd bundle just doesn't work.
Input
component everywhereprocess.env.NODE_ENV
with production to prevent crashing in umd bundle because prop types package does not exists.I think this can be published as minor.
before
daypicker.js 102.1K
daypicker.min.js 39.27K
after
daypicker.js 95.68K
daypicker.min.js 39.27K