Skip to content

Commit

Permalink
Added es build, which will get beneficial for es2015 modules aware bu…
Browse files Browse the repository at this point in the history
…ndlers like webpack 2+ and rollup
  • Loading branch information
Andarist committed Nov 27, 2017
1 parent 1437e67 commit c53cf80
Show file tree
Hide file tree
Showing 5 changed files with 642 additions and 595 deletions.
12 changes: 1 addition & 11 deletions .babelrc
@@ -1,15 +1,5 @@
{
"presets": [
["latest", {
"es2015": { "loose": true }
}],
"stage-2",
"react"
],
"plugins": [
"dev-expression",
"add-module-exports",
"transform-object-assign",
["transform-react-remove-prop-types", { "mode": "wrap" }]
"./.babelrc.js"
]
}
18 changes: 18 additions & 0 deletions .babelrc.js
@@ -0,0 +1,18 @@
const modules = process.env.BABEL_ENV === 'es' ? false : 'commonjs'

const presets = [
['latest', {
es2015: { loose: true, modules }
}],
'stage-2',
'react'
]

const plugins = [
'dev-expression',
'add-module-exports',
'transform-object-assign',
['transform-react-remove-prop-types', { mode: 'wrap' }]
]

module.exports = { plugins, presets }
6 changes: 5 additions & 1 deletion package.json
Expand Up @@ -3,11 +3,14 @@
"version": "2.3.0-beta.0",
"description": "A react component toolset for managing animations",
"main": "lib/index.js",
"module": "lib/es/index.js",
"scripts": {
"test": "npm run lint && npm run testonly",
"testonly": "jest --verbose",
"tdd": "jest --watch",
"build": "rimraf lib && babel src --out-dir lib && npm run build:dist && cp README.md LICENSE ./lib",
"build": "rimraf lib && npm run build:cjs && npm run build:es && npm run build:dist && cp README.md LICENSE ./lib",
"build:es": "cross-env BABEL_ENV=es babel src --out-dir lib/es",
"build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir lib",
"build:dist": "rimraf lib/dist && webpack && NODE_ENV=production webpack -p",
"lint": "eslint src test",
"release": "release",
Expand Down Expand Up @@ -71,6 +74,7 @@
"babel-preset-latest": "^6.24.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-2": "^6.18.0",
"cross-env": "^5.0.1",
"enzyme": "^3.0.0",
"enzyme-adapter-react-16": "^1.0.0",
"eslint": "^3.17.1",
Expand Down
16 changes: 4 additions & 12 deletions src/index.js
@@ -1,12 +1,4 @@
import CSSTransition from './CSSTransition';
import ReplaceTransition from './ReplaceTransition';
import TransitionGroup from './TransitionGroup';
import Transition from './Transition';


module.exports = {
Transition,
TransitionGroup,
ReplaceTransition,
CSSTransition,
};
export { default as CSSTransition } from './CSSTransition';
export { default as ReplaceTransition } from './ReplaceTransition';
export { default as TransitionGroup } from './TransitionGroup';
export { default as Transition } from './Transition';

0 comments on commit c53cf80

Please sign in to comment.