Skip to content

Commit

Permalink
Merge pull request gpbl#637 from TrySound/fix-umd-env
Browse files Browse the repository at this point in the history
Replace env with production to fix umd crashing in runtime
  • Loading branch information
gpbl authored Mar 4, 2018
2 parents f899b49 + ea9f56f commit ce4160a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
3 changes: 1 addition & 2 deletions DayPicker.dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/* eslint-disable no-var */
/* eslint-env node */

var DayPicker = require('./src/DayPicker').default;
DayPicker.Input = require('./src/DayPickerInput').default;
var DayPicker = require('./src').default;

module.exports = DayPicker;
8 changes: 1 addition & 7 deletions DayPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,12 @@
/* eslint-disable no-var */
/* eslint-env node */

var DayPicker = require('./lib/src/DayPicker');
var DateUtils = require('./lib/src/DateUtils');
var LocaleUtils = require('./lib/src/LocaleUtils');
var ModifiersUtils = require('./lib/src/ModifiersUtils');
var DayPicker = require('./lib/src');
var Weekday = require('./lib/src/Weekday');
var Navbar = require('./lib/src/Navbar');
var PropTypes = require('./lib/src/PropTypes');

module.exports = DayPicker;
module.exports.DateUtils = DateUtils;
module.exports.LocaleUtils = LocaleUtils;
module.exports.ModifiersUtils = ModifiersUtils;
module.exports.WeekdayPropTypes = Weekday.propTypes;
module.exports.NavbarPropTypes = Navbar.propTypes;
module.exports.PropTypes = PropTypes;
4 changes: 0 additions & 4 deletions src/DayPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,3 @@ export default class DayPicker extends Component {
);
}
}

DayPicker.DateUtils = DateUtils;
DayPicker.LocaleUtils = LocaleUtils;
DayPicker.ModifiersUtils = ModifiersUtils;
16 changes: 12 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
export default from './DayPicker';
export DateUtils from './DateUtils';
export LocaleUtils from './LocaleUtils';
export ModifiersUtils from './ModifiersUtils';
import DayPicker from './DayPicker';
import Input from './DayPickerInput';
import * as DateUtils from './DateUtils';
import * as LocaleUtils from './LocaleUtils';
import * as ModifiersUtils from './ModifiersUtils';

DayPicker.Input = Input;
DayPicker.DateUtils = DateUtils;
DayPicker.LocaleUtils = LocaleUtils;
DayPicker.ModifiersUtils = ModifiersUtils;

export default DayPicker;
7 changes: 7 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* eslint global-require: 0, import/no-extraneous-dependencies: 0 */
/* eslint-env node */

const webpack = require('webpack');

const isProduction = process.env.NODE_ENV === 'production';

module.exports = {
Expand Down Expand Up @@ -29,6 +31,11 @@ module.exports = {
},
],
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
],
externals: {
react: {
root: 'React',
Expand Down

0 comments on commit ce4160a

Please sign in to comment.