Skip to content

Commit

Permalink
Add CDN support
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingalvan committed Sep 8, 2016
1 parent 3b13b50 commit 0be4cc6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ src
.flowconfig
webpack.config.js
.travis.yml
.vscode
.vscode
example
2 changes: 1 addition & 1 deletion example/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ['react-hot', 'babel-loader'],
loaders: ['babel-loader', 'react-hot'],
include: path.join(__dirname, 'index.js')
},
{
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "react-anime",
"version": "0.1.2",
"version": "0.1.4",
"description": "Bringing anime.js to the React Community!",
"main": "dist/anime.min.js",
"scripts": {
"build:develop": "cross-env NODE_ENV=development webpack src/anime.js dist/anime.js",
"build:production": "cross-env NODE_ENV=production webpack src/anime.js dist/anime.min.js",
"build:publish": "npm run build:develop && npm run build:production",
"build:cdn": "cross-env NODE_ENV=production webpack --config webpack.cdn.js src/anime.js dist/cdn/anime.min.js",
"test": "jest --coverage",
"coverage": "jest && codecov",
"test:watch": "jest --converage --watch"
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ npm run coverage

[cover-img]: docs/cover.gif
[cover-url]: http://codepen.io/alaingalvan/details/EgjbKP/
[release-img]: https://img.shields.io/badge/release-0.1.0-4dbfcc.svg?style=flat-square
[release-img]: https://img.shields.io/badge/release-0.1.4-4dbfcc.svg?style=flat-square
[license-img]: http://img.shields.io/:license-mit-blue.svg?style=flat-square
[license-url]: https://opensource.org/licenses/MIT
[david-url]: https://david-dm.org/alaingalvan/react-anime
Expand Down
23 changes: 23 additions & 0 deletions webpack.cdn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var config = require('./webpack.config.js');

var cdnConfig = Object.assign(
{},
config,
{
output: {
library: 'ReactAnime',
libraryTarget: 'var'
},

externals: [
{
"react": {
var: 'React',
},
"animejs": {
var: 'anime',
}
}]
});

module.exports = cdnConfig;

0 comments on commit 0be4cc6

Please sign in to comment.