Skip to content

Commit

Permalink
Incorporated development + production builds into /dist (reactjs#64) and
Browse files Browse the repository at this point in the history
updated Readme to include CDN/External information.
  • Loading branch information
virgofx committed May 29, 2017
1 parent 97f5f4b commit efd8907
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
## [v1.1.X]
> 2017-XX-XX
- **Feature:** Dist build now includes both production and development builds ([#64])

## [v1.1.3]
> 2017-05-02
Expand Down
22 changes: 21 additions & 1 deletion README.md
Expand Up @@ -20,14 +20,34 @@ npm install react-transition-group --save
yarn add react-transition-group
```

## CDN / External

To exclude the react-transition-group package from your primary build and use an external CDN when bundling, link
to the following CDN:

[https://unpkg.com/react-transition-group/dist/react-transition-group.min.js](https://unpkg.com/react-transition-group/dist/react-transition-group.min.js)

In order to exclude react-transition-group using **Webpack**, include the following configuration in the `externals`
webpack configuration section:

```
externals: {
'react-transition-group': {
amd: 'react-transition-group',
commonjs2: 'react-transition-group',
commonjs: 'react-transition-group',
root: 'ReactTransitionGroup',
}
```

## High-level API: CSSTransitionGroup

`CSSTransitionGroup` is a high-level API based on [`TransitionGroup`](#low-level-api-transitiongroup) and is an easy way to perform CSS transitions and animations when a React component enters or leaves the DOM. It's inspired by the excellent [ng-animate](http://www.nganimate.org/) library.

**Importing**

```javascript
import CSSTransitionGroup from 'react-transition-group/CSSTransitionGroup' // ES6
import { CSSTransitionGroup } from 'react-transition-group' // ES6

var CSSTransitionGroup = require('react-transition-group/CSSTransitionGroup') // ES5 with npm
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -7,7 +7,7 @@
"test": "jest --runInBand --verbose",
"tdd": "jest --watch",
"build": "rimraf lib && babel src --out-dir lib && npm run build:dist",
"build:dist": "rimraf lib/dist && webpack -p --define process.env.NODE_ENV='production'",
"build:dist": "rimraf lib/dist && webpack && NODE_ENV=production webpack -p",
"lint": "eslint src test",
"release": "release"
},
Expand Down
4 changes: 3 additions & 1 deletion webpack.config.js
Expand Up @@ -3,7 +3,9 @@ const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
filename: 'react-transition-group.js',
filename: process.env.NODE_ENV === 'production'
? 'react-transition-group.min.js'
: 'react-transition-group.js',
path: path.join(__dirname, 'lib/dist'),
library: 'ReactTransitionGroup',
libraryTarget: 'umd',
Expand Down

0 comments on commit efd8907

Please sign in to comment.