Skip to content

Commit 59617ce

Browse files
committed
replace deprecated rollup-plugin-terser with @rollup/plugin-terser and update rollup.config.mjs
1 parent 42a6320 commit 59617ce

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"@babel/preset-typescript": "^7.18.6",
5656
"@rollup/plugin-babel": "^6.0.3",
5757
"@rollup/plugin-replace": "^5.0.1",
58+
"@rollup/plugin-terser": "^0.2.0",
5859
"@rollup/plugin-typescript": "^10.0.1",
5960
"@storybook/addon-storysource": "^6.5.14",
6061
"@storybook/addons": "^6.5.14",
@@ -96,9 +97,8 @@
9697
"react-window": "^1.8.8",
9798
"rimraf": "^3.0.2",
9899
"rollup": "^3.6.0",
99-
"rollup-plugin-terser": "^7.0.2",
100100
"styled-components": "^5.3.6",
101-
"typescript": "^4.9.3",
101+
"typescript": "^4.9.4",
102102
"webpack": "^5.75.0"
103103
},
104104
"peerDependencies": {
@@ -109,7 +109,7 @@
109109
},
110110
"scripts": {
111111
"clean-build": "npm-run-all clean build",
112-
"build": "tsc --outDir dist --declarationDir dist --declaration true --emitDeclarationOnly true && rollup -c",
112+
"build": "tsc --outDir dist --declarationDir dist --declaration true --emitDeclarationOnly true && rollup --bundleConfigAsCjs -c",
113113
"build-watch": "rollup -c -w",
114114
"clean": "rimraf dist",
115115
"typecheck": "tsc -p --noEmit",

rollup.config.mjs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import path from 'path';
22
import babel from '@rollup/plugin-babel';
3+
import terser from '@rollup/plugin-terser';
34
import replace from '@rollup/plugin-replace';
4-
import { terser } from 'rollup-plugin-terser';
55
import { DEFAULT_EXTENSIONS } from '@babel/core';
66
import typescript from '@rollup/plugin-typescript';
7-
import { createRequire } from 'node:module';
8-
9-
const require = createRequire(import.meta.url);
10-
const pkg = require('./package.json');
7+
import pkg from './package.json' assert { type: 'json' };
118

129
const globals = {
1310
'react': 'React',

0 commit comments

Comments
 (0)