Skip to content

Commit

Permalink
build: add browserslist plugin to tsup and update supported browsers,…
Browse files Browse the repository at this point in the history
… #closes 81
  • Loading branch information
nerdyman committed Nov 28, 2022
1 parent b17eed0 commit 60c3a26
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:

- name: 🧪 Test
run: |
npx playwright install-deps chromium
pnpm run --filter @this/example build
pnpm run test:ci
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"last 2 chrome versions",
"last 2 edge versions",
"last 2 firefox versions",
"last 2 safari versions",
"safari >= 15.6",
"ios >= 15.6",
"not dead",
"not ie > 0",
"not op_mini all"
Expand Down Expand Up @@ -94,7 +95,9 @@
"@types/resize-observer-browser": "^0.1.7",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"browserslist": "^4.21.4",
"concurrently": "^7.6.0",
"esbuild-plugin-browserslist": "^0.5.2",
"eslint": "^8.28.0",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
Expand Down
22 changes: 22 additions & 0 deletions pnpm-lock.yaml

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

9 changes: 8 additions & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
/* eslint no-console: 0 */
import browserslist from 'browserslist';
import { resolveToEsbuildTarget } from 'esbuild-plugin-browserslist';
import { defineConfig } from 'tsup';

const target = resolveToEsbuildTarget(browserslist());

console.info('[tsup] Target:', target);

export default defineConfig((options) => ({
clean: true,
dts: true,
entry: ['src/index.ts'],
format: ['esm'],
minify: !options.watch,
target: 'es2021',
target,
sourcemap: true,
splitting: true,
treeshake: true,
Expand Down

0 comments on commit 60c3a26

Please sign in to comment.