diff --git a/dist/react-chartjs.js b/dist/react-chartjs.js index 072008f..3306a53 100644 --- a/dist/react-chartjs.js +++ b/dist/react-chartjs.js @@ -4,9 +4,9 @@ else if(typeof define === 'function' && define.amd) define(["react", "react-dom", "Chartjs"], factory); else if(typeof exports === 'object') - exports["react-chartjs"] = factory(require("react"), require("react-dom"), require("Chartjs")); + exports["ReactChartJs"] = factory(require("react"), require("react-dom"), require("Chartjs")); else - root["react-chartjs"] = factory(root["React"], root["ReactDOM"], root["Chart"]); + root["ReactChartJs"] = factory(root["React"], root["ReactDOM"], root["Chart"]); })(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_12__, __WEBPACK_EXTERNAL_MODULE_13__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache @@ -54,16 +54,27 @@ return /******/ (function(modules) { // webpackBootstrap /* 0 */ /***/ (function(module, exports, __webpack_require__) { + const Bar = __webpack_require__(1); + const Doughnut = __webpack_require__(14); + const Line = __webpack_require__(15); + const Pie = __webpack_require__(16); + const PolarArea = __webpack_require__(17); + const Radar = __webpack_require__(18); + const createClass = __webpack_require__(2).createClass; + module.exports = { - Bar: __webpack_require__(1), - Doughnut: __webpack_require__(14), - Line: __webpack_require__(15), - Pie: __webpack_require__(16), - PolarArea: __webpack_require__(17), - Radar: __webpack_require__(18), - createClass: __webpack_require__(2).createClass + Bar, + Doughnut, + Line, + Pie, + PolarArea, + Radar, + createClass, }; + export { Bar, Doughnut, Line, Pie, PolarArea, Radar }; + + /***/ }), /* 1 */ diff --git a/index.js b/index.js index beaedd0..1ff61a7 100644 --- a/index.js +++ b/index.js @@ -1,9 +1,20 @@ +const Bar = require('./lib/bar'); +const Doughnut = require('./lib/doughnut'); +const Line = require('./lib/line'); +const Pie = require('./lib/pie'); +const PolarArea = require('./lib/polar-area'); +const Radar = require('./lib/radar'); +const createClass = require('./lib/core').createClass; + module.exports = { - Bar: require('./lib/bar'), - Doughnut: require('./lib/doughnut'), - Line: require('./lib/line'), - Pie: require('./lib/pie'), - PolarArea: require('./lib/polar-area'), - Radar: require('./lib/radar'), - createClass: require('./lib/core').createClass + Bar, + Doughnut, + Line, + Pie, + PolarArea, + Radar, + createClass, }; + +export { Bar, Doughnut, Line, Pie, PolarArea, Radar }; + diff --git a/webpack.config.js b/webpack.config.js index a810692..ea6e4f4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,50 +1,43 @@ var webpack = require('webpack'), - plugins = []; + plugins = []; if (process.env.COMPRESS) { - plugins.push( - new webpack.optimize.UglifyJsPlugin({ - compressor: { - warnings: false - } - }) - ); + plugins.push( + new webpack.optimize.UglifyJsPlugin({ + compressor: { + warnings: false + } + }) + ); } module.exports = { - - output: { - library: 'react-chartjs', - libraryTarget: 'umd' + output: { + library: 'ReactChartJs', + libraryTarget: 'umd' + }, + externals: [{ + 'react': { + root: 'React', + commonjs2: 'react', + commonjs: 'react', + amd: 'react' }, - - externals: [ - { - "react": { - root: "React", - commonjs2: "react", - commonjs: "react", - amd: "react" - }, - "react-dom": { - root: "ReactDOM", - commonjs2: "react-dom", - commonjs: "react-dom", - amd: "react-dom" - }, - "chart.js": { - root: "Chart", - commonjs2: "Chartjs", - commonjs: "Chartjs", - amd: "Chartjs" - } - } - ], - - node: { - Buffer: false + 'react-dom': { + root: 'ReactDOM', + commonjs2: 'react-dom', + commonjs: 'react-dom', + amd: 'react-dom' }, - - plugins: plugins - + 'chart.js': { + root: 'Chart', + commonjs2: 'Chartjs', + commonjs: 'Chartjs', + amd: 'Chartjs' + } + }], + node: { + Buffer: false + }, + plugins: plugins };