Skip to content

Commit 0a2e07a

Browse files
feat: migrated rollup to esbuild
1 parent 1bbd938 commit 0a2e07a

File tree

5 files changed

+18
-25
lines changed

5 files changed

+18
-25
lines changed

packages/react/babel.config.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/react/esbuild.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import esbuild from 'esbuild'
2+
3+
await esbuild.build({
4+
outfile: `./dist/index.js`,
5+
entryPoints: ['src/index.ts'],
6+
tsconfig: './tsconfig.json',
7+
bundle: true,
8+
platform: 'neutral',
9+
format: 'esm',
10+
packages: 'external',
11+
})

packages/react/package.json

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
"author": "cloudinary",
66
"license": "MIT",
77
"repository": "https://github.com/cloudinary/frontend-frameworks",
8-
"main": "dist/index.umd.js",
9-
"module": "dist/index.js",
10-
"types": "dist/index.d.ts",
8+
"main": "dist/index.esm.js",
119
"files": [
1210
"package.json",
1311
"dist"
@@ -17,7 +15,7 @@
1715
"node": ">=18"
1816
},
1917
"scripts": {
20-
"build": "npm run build --prefix ../html && tsc && rollup -c && cp package.json ./dist",
18+
"build": "node ./esbuild.mjs && tsc && cp package.json ./dist",
2119
"lint": "eslint ./src",
2220
"typecheck": "tsc --noEmit --skipLibCheck --project ./tsconfig.json",
2321
"test": "mocha src/**/*.test.*",
@@ -26,18 +24,11 @@
2624
"build-storybook": "storybook build"
2725
},
2826
"peerDependencies": {
27+
"@cloudinary/url-gen": "^1.16.0",
2928
"react": "^16.3.0 || ^17.0.0 || ^18.0.0"
3029
},
3130
"devDependencies": {
32-
"@babel/preset-env": "^7.12.10",
33-
"@babel/preset-typescript": "^7.12.7",
34-
"@cloudinary/url-gen": "^1.21.0",
3531
"@chromatic-com/storybook": "^3.2.2",
36-
"@rollup/plugin-commonjs": "^21.0.1",
37-
"@rollup/plugin-json": "^4.1.0",
38-
"@rollup/plugin-node-resolve": "^13.1.3",
39-
"@rollup/plugin-replace": "^3.0.1",
40-
"@rollup/plugin-typescript": "^8.3.0",
4132
"@storybook/addon-essentials": "^8.4.7",
4233
"@storybook/addon-interactions": "^8.4.7",
4334
"@storybook/addon-onboarding": "^8.4.7",
@@ -54,7 +45,7 @@
5445
"@typescript-eslint/eslint-plugin": "^5.62.0",
5546
"@typescript-eslint/parser": "^5.62.0",
5647
"assert": "^2.1.0",
57-
"cross-env": "^7.0.2",
48+
"esbuild": "^0.24.0",
5849
"eslint": "^7.32.0",
5950
"eslint-config-prettier": "^6.7.0",
6051
"eslint-config-standard": "^14.1.0",
@@ -73,10 +64,8 @@
7364
"prettier": "^3.4.1",
7465
"react": "^16.13.1",
7566
"react-dom": "^16.13.1",
76-
"rollup": "^2.66.1",
7767
"storybook": "^8.4.7",
7868
"ts-node": "^10.9.2",
79-
"tslib": "^2.8.1",
8069
"typescript": "^5.7.2"
8170
}
8271
}
File renamed without changes.

packages/react/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"module": "esnext",
5-
"target": "esnext",
5+
"target": "ES2022",
66
"declarationDir" : "./dist",
77
"lib": [
88
"dom",
@@ -28,9 +28,9 @@
2828
"resolveJsonModule": true,
2929
"isolatedModules": false,
3030
"emitDeclarationOnly": true,
31-
"types": ["node"],
31+
"types": ["node"]
3232
},
33-
"include": ["./src/**/*.*", "./.eslintrc.js"],
33+
"include": ["./src/**/*.*"],
3434
"exclude": [
3535
"node_modules",
3636
"dist",

0 commit comments

Comments
 (0)