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 May 14, 2018
1 parent 780e8e5 commit 97dcac6
Show file tree
Hide file tree
Showing 5 changed files with 674 additions and 701 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 }
17 changes: 11 additions & 6 deletions package.json
Expand Up @@ -3,18 +3,24 @@
"version": "2.3.1",
"description": "A react component toolset for managing animations",
"main": "lib/index.js",
"module": "es/index.js",
"scripts": {
"test": "npm run lint && npm run testonly",
"testonly": "jest --verbose",
"tdd": "jest --watch",
"commitmsg": "commitlint -e $GIT_PARAMS",
"build": "rimraf lib && babel src --out-dir lib && npm run build:dist && cp README.md LICENSE ./lib",
"prebuild": "rimraf lib es dist",
"build": "npm run build:cjs && npm run build:es && npm run build:dist",
"build:es": "cross-env BABEL_ENV=es babel src --out-dir es",
"build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir lib",
"build:dist": "webpack && NODE_ENV=production webpack -p",
"build:docs": "npm -C www run build",
"build:dist": "rimraf lib/dist && webpack && NODE_ENV=production webpack -p",
"bootstrap": "yarn && yarn --cwd www",
"lint": "eslint src test",
"prerelease": "cherry-pick",
"release": "release",
"release:next": "release --preid beta --tag next",
"release:next": "npm run release -- --preid beta --tag next",
"postrelease": "cherry-pick clean",
"deploy-docs": "npm -C www run deploy",
"start": "npm -C www run develop",
"storybook": "start-storybook -p 6006",
Expand Down Expand Up @@ -83,6 +89,8 @@
"babel-preset-latest": "^6.24.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-2": "^6.18.0",
"cherry-pick": "^0.2.0",
"cross-env": "^5.0.1",
"enzyme": "^3.0.0",
"enzyme-adapter-react-16": "^1.0.0",
"eslint": "^3.17.1",
Expand All @@ -100,7 +108,6 @@
"release-script": "^1.0.2",
"rimraf": "^2.6.1",
"semantic-release": "^15.1.7",
"semantic-release-alt-publish-dir": "^2.1.1",
"sinon": "^2.1.0",
"travis-deploy-once": "^4.4.1",
"webpack": "^3.6.0",
Expand All @@ -110,13 +117,11 @@
"pkgRoot": "lib",
"verifyConditions": [
"@semantic-release/changelog",
"semantic-release-alt-publish-dir",
"@semantic-release/git",
"@semantic-release/github"
],
"prepare": [
"@semantic-release/changelog",
"semantic-release-alt-publish-dir",
"@semantic-release/npm",
"@semantic-release/git"
]
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 97dcac6

Please sign in to comment.