diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efcea24..a5c6ff4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: node-version: [14.x, 16.x, 17.x] react-version: [17.x, 18.x] include: - - node-version: 12.x + - node-version: 14.x react-version: 16.0.0 runs-on: ubuntu-latest steps: diff --git a/package.json b/package.json index 58653d2..585fc1a 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "proxyquire": "^2.1.3", "react": "^18.0.0", "react-dom": "^18.0.0", - "rollup": "^2.35.0", + "rollup": "^3.1.0", "tsd": "^0.24.1" }, "sideEffects": false diff --git a/rollup.config.js b/rollup.config.js deleted file mode 100644 index c5b22d9..0000000 --- a/rollup.config.js +++ /dev/null @@ -1,21 +0,0 @@ -import babel from '@rollup/plugin-babel'; - -const meta = require('./package.json'); - -process.env.BABEL_ENV = 'rollup'; - -export default { - input: './src/index.js', - output: [ - { format: 'cjs', file: meta.main, exports: 'named' }, - { format: 'es', file: meta.module }, - ], - - external: Object.keys(meta.dependencies) - .concat(Object.keys(meta.peerDependencies)), - plugins: [ - babel({ - babelHelpers: 'bundled', - }), - ], -}; diff --git a/rollup.config.mjs b/rollup.config.mjs new file mode 100644 index 0000000..07ff5ea --- /dev/null +++ b/rollup.config.mjs @@ -0,0 +1,22 @@ +import fs from 'fs'; +import babel from '@rollup/plugin-babel'; + +const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8')); + +process.env.BABEL_ENV = 'rollup'; + +export default { + input: './src/index.js', + output: [ + { format: 'cjs', file: pkg.main, exports: 'named' }, + { format: 'es', file: pkg.module }, + ], + + external: Object.keys(pkg.dependencies) + .concat(Object.keys(pkg.peerDependencies)), + plugins: [ + babel({ + babelHelpers: 'bundled', + }), + ], +};