Skip to content

Commit

Permalink
feat(build): add umd support
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmeinke committed Mar 15, 2016
1 parent ebecfd1 commit f23bb8b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/
lib/
node_modules/
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Animated SVG charts for React.

**3.9kb gzipped.**

However, you're currently also going to have to bring
[babel polyfill](https://cdnjs.com/libraries/babel-polyfill)
to the party at an additional 30.8kb gzipped. This is to
support Javascript generators which a dependency of this library
makes use of.

![Line chart example](https://www.dropbox.com/s/vnm0u1k8orkc5n8/line-chart.gif?raw=1)

[View line chart example code](./examples/lineChart)
Expand Down
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@
"description": "Animated SVG charts for React",
"devDependencies": {
"babel-cli": "^6.6.5",
"babel-loader": "^6.2.4",
"babel-plugin-transform-object-rest-spread": "^6.6.5",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"commitizen": "^2.7.2",
"cz-conventional-changelog": "^1.1.5",
"react": "^15.0.0-rc.1",
"semantic-release": "^4.3.5"
"rimraf": "^2.5.2",
"semantic-release": "^4.3.5",
"webpack": "^1.12.14"
},
"keywords": [
"animate",
Expand All @@ -60,9 +63,14 @@
"url": "https://github.com/colinmeinke/react-svg-chart.git"
},
"scripts": {
"build": "babel src --out-dir lib",
"build": "npm run build:lib && npm run build:umd",
"build:lib": "babel src --out-dir lib",
"build:umd": "npm run build:umd:dev && npm run build:umd:pro",
"build:umd:dev": "webpack ./src/index.js ./dist/react-svg-chart.js --output-library ReactSVGChart --output-library-target umd --config ./webpack.config.babel.js",
"build:umd:pro": "webpack -p ./src/index.js ./dist/react-svg-chart.min.js --output-library ReactSVGChart --output-library-target umd --config ./webpack.config.babel.js",
"clean": "rimraf lib dist",
"commit": "git-cz",
"prepublish": "npm run build",
"prepublish": "npm run clean && npm run build",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"version": "0.0.0-semantically-released"
Expand Down
12 changes: 12 additions & 0 deletions webpack.config.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default {
externals: {
react: 'React',
},
module: {
loaders: [{
exclude: /node_modules/,
loader: 'babel',
test: /\.js$/,
}],
},
};

0 comments on commit f23bb8b

Please sign in to comment.