Skip to content

Commit

Permalink
fix: use esbuild instead of terser
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyshlyaev177 committed Nov 21, 2024
1 parent 68576fb commit 59226b0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
typings.d.ts
package.json
playwright.config.ts
rollup.config.js
rollup.config.*
.eslintrc.cjs
*.test.ts
*.test.tsx
Expand Down
72 changes: 21 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"command": "npm run dev:nextjs14"
},
"dev:lib": {
"command": "cross-env IS_DEVELOPMENT=true rollup -c rollup.config.js --bundleConfigAsCjs -w",
"command": "cross-env IS_DEVELOPMENT=true rollup -c rollup.config.mjs -w",
"service": {
"readyWhen": {
"lineMatches": "created "
Expand Down Expand Up @@ -287,7 +287,7 @@
"command": "cd packages/example-react && npm run build"
},
"build": {
"command": "rollup -c rollup.config.js --bundleConfigAsCjs",
"command": "rollup -c rollup.config.mjs",
"dependencies": [
"rmdist"
]
Expand Down Expand Up @@ -336,7 +336,6 @@
"@commitlint/config-conventional": "^19.0.3",
"@playwright/test": "^1.48.2",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^13.0.0",
Expand Down Expand Up @@ -376,6 +375,7 @@
"prettier-plugin-tailwindcss": "^0.6.8",
"release-it": "^17.6.0",
"rollup": "^4.23.0",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-filesize": "^10.0.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"semantic-release": "^24.1.0",
Expand Down
10 changes: 7 additions & 3 deletions rollup.config.js → rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import resolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
import esbuild from 'rollup-plugin-esbuild'
import sourcemaps from 'rollup-plugin-sourcemaps';
import typescript from '@rollup/plugin-typescript';
import filesize from 'rollup-plugin-filesize';
import { glob } from 'glob'
import config from './tsconfig.json'
import config from './tsconfig.json' assert { type: "json" };

const isProduction = !process.env.IS_DEVELOPMENT;
const sourcemap = !isProduction;
Expand All @@ -25,7 +25,11 @@ const plugins = [


!isProduction && sourcemaps(),
isProduction && terser({ ecma: '2022' }),
esbuild({
sourceMap: !isProduction, // default
minify: isProduction,
target: 'es2023', // default, or 'es20XX', 'esnext'
}),
filesize(),
].filter(Boolean);

Expand Down

0 comments on commit 59226b0

Please sign in to comment.