Skip to content

Commit 0a032e3

Browse files
jerairrestgor181
authored andcommitted
Fixed UMD reference. window.reactChartjs2 (#82)
1 parent c017c3b commit 0a032e3

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

dist/react-chartjs-2.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.index = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
1+
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.reactChartjs2 = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
22
(function (global){
33
/**
44
* lodash (Custom Build) <https://lodash.com/>
@@ -1668,11 +1668,11 @@ var _react = (typeof window !== "undefined" ? window['React'] : typeof global !=
16681668

16691669
var _react2 = _interopRequireDefault(_react);
16701670

1671-
var _reactDom = require('react-dom');
1671+
var _reactDom = (typeof window !== "undefined" ? window['ReactDOM'] : typeof global !== "undefined" ? global['ReactDOM'] : null);
16721672

16731673
var _reactDom2 = _interopRequireDefault(_reactDom);
16741674

1675-
var _chart = require('chart.js');
1675+
var _chart = (typeof window !== "undefined" ? window['Chart'] : typeof global !== "undefined" ? global['Chart'] : null);
16761676

16771677
var _chart2 = _interopRequireDefault(_chart);
16781678

@@ -2128,5 +2128,5 @@ var defaults = exports.defaults = _chart2.default.defaults;
21282128
exports.Chart = _chart2.default;
21292129

21302130
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2131-
},{"chart.js":undefined,"lodash.isequal":1,"react-dom":undefined}]},{},[2])(2)
2131+
},{"lodash.isequal":1}]},{},[2])(2)
21322132
});

dist/react-chartjs-2.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ var initGulpTasks = require('react-component-gulp-tasks');
1313
var taskConfig = {
1414

1515
component: {
16-
name: 'index',
16+
name: 'react-chartjs-2',
1717
dependencies: [
1818
'react',
1919
'react-dom',
2020
'chart.js'
2121
],
22-
lib: 'lib'
22+
lib: 'lib',
23+
file: 'index.js'
2324
},
2425

2526
example: {

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
"react-dom": "^0.14 || ^15.0.0-rc || ^15.0"
4545
},
4646
"browserify-shim": {
47-
"react": "global:React"
47+
"react": "global:React",
48+
"react-dom": "global:ReactDOM",
49+
"chart.js": "global:Chart"
4850
},
4951
"scripts": {
5052
"build": "gulp clean && NODE_ENV=production gulp build",

0 commit comments

Comments
 (0)