Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added es build, which will get beneficial for es2015 modules aware bu… #77

Merged
merged 1 commit into from
Jun 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm so glad that you switched to .babelrc.js because I don't trust Babel's env, plus it causes duplication.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😉 I never have trusted babel's env either, I'm rly glad that I have found this neat trick 😀

]
}
20 changes: 20 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { NODE_ENV, BABEL_ENV } = process.env
const cjs = NODE_ENV === 'test' || BABEL_ENV === 'cjs'

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

const plugins = [
'dev-expression',
'transform-object-assign',
['transform-react-remove-prop-types', { mode: 'wrap' }],
cjs && 'add-module-exports',
cjs && 'transform-es2015-modules-commonjs',
].filter(Boolean)

module.exports = { plugins, presets }
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/lib
/esm

# Logs
logs
Expand Down
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
"version": "2.3.1",
"description": "A react component toolset for managing animations",
"main": "lib/index.js",
"module": "lib/index.mjs",
"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",
"prebuild": "rimraf lib esm",
"build": "npm run build:cjs && npm run build:esm && npm run build:mjs && npm run build:dist && cp README.md LICENSE ./lib",
"build:esm": "cross-env BABEL_ENV=esm babel src --out-dir esm",
"build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir lib",
"build:mjs": "copy-mjs && rimraf esm",
"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",
"release": "release",
"release:next": "release --preid beta --tag next",
"deploy-docs": "npm -C www run deploy",
"start": "npm -C www run develop",
"storybook": "start-storybook -p 6006",
Expand Down Expand Up @@ -77,11 +80,14 @@
"babel-loader": "^6.4.1",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.5",
"babel-preset-latest": "^6.24.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-2": "^6.18.0",
"copy-mjs": "^0.1.0",
"cross-env": "^5.0.1",
"enzyme": "^3.0.0",
"enzyme-adapter-react-16": "^1.0.0",
"eslint": "^3.17.1",
Expand All @@ -97,10 +103,9 @@
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-test-renderer": "^16.0.0",
"release-script": "^1.0.2",
"rimraf": "^2.6.1",
"semantic-release": "^15.1.7",
"semantic-release-alt-publish-dir": "^2.1.1",
"semantic-release-alt-publish-dir": "^2.1.2",
"sinon": "^2.1.0",
"travis-deploy-once": "^4.4.1",
"webpack": "^3.6.0",
Expand Down
16 changes: 4 additions & 12 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -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';
Loading