Skip to content

Commit

Permalink
chore(rollup): use new plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
moklick committed Oct 21, 2020
1 parent 5d787ca commit f57e053
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
],
"@babel/preset-react"
],
"plugins": []
}
"plugins": ["@babel/plugin-transform-runtime"]
}
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"test:firefox": "cypress run --browser firefox",
"test:all": "npm run test:chrome && npm run test:firefox",
"test": "npm run dev:wait test:chrome",
"release": "release-it",
"postinstall": "cd example && npm install"
"release": "release-it"
},
"dependencies": {
"@babel/runtime": "^7.9.0",
"@welldone-software/why-did-you-render": "^4.3.2",
"classcat": "^4.1.0",
"d3-selection": "^2.0.0",
Expand All @@ -38,8 +38,13 @@
},
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/plugin-transform-runtime": "^7.9.0",
"@babel/preset-env": "^7.12.1",
"@babel/preset-react": "^7.12.1",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
"@svgr/rollup": "^5.4.0",
"@types/classnames": "^2.2.10",
"@types/d3": "^5.16.3",
Expand All @@ -53,13 +58,9 @@
"prop-types": "^15.7.2",
"react": "^16.14.0",
"release-it": "^14.2.0",
"rollup": "^2.32.0",
"rollup-plugin-babel": "^4.4.0",
"rollup": "^2.28.2",
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-postcss": "^3.1.8",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-typescript2": "^0.28.0",
"start-server-and-test": "^1.11.5",
"typescript": "^4.0.3"
Expand Down
11 changes: 6 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import babel from '@rollup/plugin-babel';
import postcss from 'rollup-plugin-postcss';
import bundleSize from 'rollup-plugin-bundle-size';
import replace from 'rollup-plugin-replace';
import replace from '@rollup/plugin-replace';
import svgr from '@svgr/rollup';
import typescript from 'rollup-plugin-typescript2';

Expand All @@ -15,7 +15,7 @@ const processEnv = isProd ? 'production' : 'development';
export default [
{
input: 'src/index.ts',
external: ['react', 'react-dom'],
external: ['react', 'react-dom', /@babel\/runtime/],
onwarn(warning, rollupWarn) {
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
rollupWarn(warning);
Expand All @@ -42,6 +42,7 @@ export default [
}),
babel({
exclude: 'node_modules/**',
babelHelpers: 'runtime',
}),
replace({
'process.env.NODE_ENV': JSON.stringify(processEnv),
Expand Down

0 comments on commit f57e053

Please sign in to comment.