Skip to content

Commit deb9b56

Browse files
committed
Upgrade dependencies and Rollup config
1 parent e8d6287 commit deb9b56

File tree

4 files changed

+1157
-1065
lines changed

4 files changed

+1157
-1065
lines changed

.flowconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,5 @@
66
.*/node_modules/react-is/.*
77
.*/node_modules/styled-components/.*
88

9-
[libs]
10-
types/
11-
129
[include]
1310
.*/node_modules/react[A-Z-a-z-]*/.*

package.json

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
"sideEffects": false,
1919
"types": "index.d.ts",
2020
"scripts": {
21-
"prepublishOnly": "run-s build",
21+
"prepublishOnly": "run-s flow test build",
2222
"build": "rollup -c rollup.config.js",
2323
"test": "jest",
24-
"flow": "flow"
24+
"flow": "flow check"
2525
},
2626
"prettier": {
2727
"semi": false,
@@ -54,29 +54,30 @@
5454
},
5555
"devDependencies": {
5656
"@ampproject/rollup-plugin-closure-compiler": "^0.26.0",
57-
"@babel/core": "^7.12.3",
58-
"@babel/plugin-transform-flow-strip-types": "^7.12.1",
59-
"@babel/plugin-transform-object-assign": "^7.12.1",
60-
"@babel/preset-env": "^7.12.1",
61-
"@babel/preset-flow": "^7.12.1",
62-
"@babel/preset-react": "^7.12.5",
57+
"@babel/core": "^7.13.1",
58+
"@babel/plugin-transform-flow-strip-types": "^7.13.0",
59+
"@babel/plugin-transform-object-assign": "^7.12.13",
60+
"@babel/preset-env": "^7.13.5",
61+
"@babel/preset-flow": "^7.12.13",
62+
"@babel/preset-react": "^7.12.13",
63+
"@rollup/plugin-babel": "^5.3.0",
6364
"@rollup/plugin-buble": "^0.21.3",
64-
"@rollup/plugin-commonjs": "^16.0.0",
65-
"@rollup/plugin-node-resolve": "^10.0.0",
65+
"@rollup/plugin-commonjs": "^17.1.0",
66+
"@rollup/plugin-node-resolve": "^11.2.0",
67+
"@rollup/plugin-replace": "^2.3.4",
6668
"babel-plugin-closure-elimination": "^1.3.2",
6769
"babel-plugin-transform-async-to-promises": "^0.8.15",
68-
"codecov": "^3.6.5",
70+
"codecov": "^3.8.1",
6971
"flow-bin": "0.122.0",
7072
"husky": "^4.3.0",
7173
"jest": "^26.6.3",
72-
"lint-staged": "^10.5.1",
74+
"lint-staged": "^10.5.4",
7375
"npm-run-all": "^4.1.5",
74-
"prettier": "^2.1.2",
76+
"prettier": "^2.2.1",
7577
"react": "^17.0.1",
7678
"react-dom": "^17.0.1",
77-
"rollup": "^2.33.1",
79+
"rollup": "^2.39.1",
7880
"rollup-plugin-babel": "^4.4.0",
79-
"rollup-plugin-replace": "^2.2.0",
8081
"rollup-plugin-terser": "^7.0.2"
8182
}
8283
}

rollup.config.js

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
import commonjs from '@rollup/plugin-commonjs'
2-
import nodeResolve from '@rollup/plugin-node-resolve'
2+
import resolve from '@rollup/plugin-node-resolve'
33
import buble from '@rollup/plugin-buble'
4-
import babel from 'rollup-plugin-babel'
4+
import babel from '@rollup/plugin-babel'
5+
import replace from '@rollup/plugin-replace'
56
import { terser } from 'rollup-plugin-terser'
67
import compiler from '@ampproject/rollup-plugin-closure-compiler'
7-
import replace from 'rollup-plugin-replace'
88

9-
const pkgInfo = require('./package.json')
10-
const { peerDependencies, dependencies } = pkgInfo
9+
const pkg = require('./package.json')
1110

12-
let external = ['dns', 'fs', 'path', 'url']
13-
14-
if (pkgInfo.peerDependencies) {
15-
external.push(...Object.keys(peerDependencies))
16-
}
17-
18-
if (pkgInfo.dependencies) {
19-
external.push(...Object.keys(dependencies))
20-
}
11+
const externalModules = [
12+
'dns',
13+
'fs',
14+
'path',
15+
'url',
16+
...Object.keys(pkg.peerDependencies || {}),
17+
...Object.keys(pkg.dependencies || {})
18+
]
2119

22-
const externalPredicate = new RegExp(`^(${external.join('|')})($|/)`)
20+
const externalPredicate = new RegExp(`^(${externalModules.join('|')})($|/)`)
2321
const externalTest = (id) => {
2422
if (id === 'babel-plugin-transform-async-to-promises/helpers') {
2523
return false
@@ -72,11 +70,13 @@ const terserMinified = terser({
7270
const makePlugins = (isProduction = false) => [
7371
babel({
7472
babelrc: false,
73+
babelHelpers: 'bundled',
7574
exclude: 'node_modules/**',
7675
presets: [],
7776
plugins: ['@babel/plugin-transform-flow-strip-types']
7877
}),
79-
nodeResolve({
78+
resolve({
79+
dedupe: externalModules,
8080
mainFields: ['module', 'jsnext', 'main'],
8181
browser: true
8282
}),
@@ -98,6 +98,7 @@ const makePlugins = (isProduction = false) => [
9898
}),
9999
babel({
100100
babelrc: false,
101+
babelHelpers: 'bundled',
101102
exclude: 'node_modules/**',
102103
presets: [],
103104
plugins: [

0 commit comments

Comments
 (0)