Skip to content

Update babel and dependencies #94

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
14 changes: 12 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{
"presets": [["env", { "targets": { "node": true } }], "stage-3", "react"],
"plugins": ["transform-class-properties"]
"presets": [
[
"@babel/preset-env",
{
"loose": true
}
],
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
}
58 changes: 27 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,51 +40,47 @@
"react-dom": "^0.14.0 || ^15.0.0 || ^16.0.0"
},
"devDependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"app-root-dir": "1.0.2",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^8.0.1",
"babel-jest": "^22.4.3",
"babel-loader": "^7.1.2",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-3": "^6.24.1",
"babel-register": "^6.26.0",
"babel-jest": "^23.6.0",
"change-case": "^3.0.2",
"codecov": "^3.0.0",
"cross-env": "^5.0.5",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.1",
"enzyme-to-json": "^3.1.2",
"codecov": "^3.1.0",
"cross-env": "^5.2.0",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.6.0",
"enzyme-to-json": "^3.3.4",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.0.0",
"eslint-config-prettier": "^2.6.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.4.0",
"gzip-size": "^4.0.0",
"husky": "^0.14.3",
"gzip-size": "^5.0.0",
"husky": "^1.1.2",
"in-publish": "2.0.0",
"jest": "^22.4.3",
"lint-staged": "^7.0.0",
"jest": "^23.6.0",
"lint-staged": "^7.3.0",
"memory-fs": "0.4.1",
"prettier": "^1.7.4",
"pretty-bytes": "4.0.2",
"prop-types": "^15.6.0",
"prettier": "^1.14.3",
"pretty-bytes": "5.1.0",
"prop-types": "^15.6.2",
"raf": "^3.4.0",
"ramda": "^0.25.0",
"react": "^16.0.0",
"react-async-bootstrapper": "^2.1.0",
"react-dom": "^16.0.0",
"react-test-renderer": "^16.0.0",
"react": "^16.5.2",
"react-async-bootstrapper": "^2.1.1",
"react-dom": "^16.5.2",
"react-test-renderer": "^16.5.2",
"readline-sync": "1.4.9",
"rimraf": "^2.6.2",
"rollup": "^0.57.1",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-uglify": "^3.0.0"
"rollup": "^0.66.6",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-uglify": "^6.0.0"
},
"jest": {
"collectCoverageFrom": [
Expand Down Expand Up @@ -147,4 +143,4 @@
"git add"
]
}
}
}
9 changes: 4 additions & 5 deletions rollup-min.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
const uglify = require('rollup-plugin-uglify')
const packageJson = require('./package.json')

const baseConfig = require('./rollup.config.js')
import { uglify } from 'rollup-plugin-uglify'
import packageJson from './package.json'
import baseConfig from './rollup.config'

baseConfig.plugins.push(uglify())
baseConfig.output.file = `dist/${packageJson.name}.min.js`

module.exports = baseConfig
export default baseConfig
17 changes: 5 additions & 12 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const babel = require('rollup-plugin-babel')
const changeCase = require('change-case')
const packageJson = require('./package.json')
import babel from 'rollup-plugin-babel'
import changeCase from 'change-case'
import packageJson from './package.json'

process.env.BABEL_ENV = 'production'

module.exports = {
export default {
external: ['react', 'prop-types'],
input: 'src/index.js',
output: {
Expand All @@ -15,12 +15,5 @@ module.exports = {
.titleCase(packageJson.name.replace(/-/g, ' '))
.replace(/ /g, ''),
},
plugins: [
babel({
babelrc: false,
exclude: 'node_modules/**',
presets: [['env', { modules: false }], 'stage-3', 'react'],
plugins: ['transform-class-properties', 'external-helpers'],
}),
],
plugins: [babel()],
}
4 changes: 3 additions & 1 deletion src/asyncComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export default function asyncComponent(config) {
const env =
['node', 'browser'].indexOf(config.env) > -1
? config.env
: typeof window === 'undefined' ? 'node' : 'browser'
: typeof window === 'undefined'
? 'node'
: 'browser'

const state = {
// A unique id we will assign to our async component which is especially
Expand Down
Loading