Skip to content

Commit

Permalink
Merge pull request #1 from atav32/es6_export
Browse files Browse the repository at this point in the history
ES6 export
  • Loading branch information
atav32 authored Jan 22, 2019
2 parents a0f0f8f + ab939fb commit ee0f770
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 57 deletions.
29 changes: 20 additions & 9 deletions dist/react-chartjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 */
Expand Down
25 changes: 18 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -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 };

75 changes: 34 additions & 41 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -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
};

0 comments on commit ee0f770

Please sign in to comment.