Skip to content

Commit

Permalink
perf: use browserslist targets (#6891)
Browse files Browse the repository at this point in the history
* perf: use browserslist targets

* update browserslist targets to be on the safe side and avoid sudden future changes
  • Loading branch information
VIKTORVAV99 authored Jul 26, 2024
1 parent f86cb57 commit 52c1362
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion web/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ prepare:
FROM +src-files
RUN npm install -g pnpm@9
RUN pnpm install --frozen-lockfile
COPY index.html .postcssrc.json tailwind.config.cjs tsconfig.json tsconfig.node.json vite.config.cts .
COPY index.html .postcssrc.json tailwind.config.cjs tsconfig.json tsconfig.node.json vite.config.ts .
COPY scripts/generateZonesConfig.ts ./scripts/generateZonesConfig.ts
COPY scripts/register-tsNodeESM.js ./scripts/register-tsNodeESM.js
COPY --dir geo public src ./
Expand Down
4 changes: 4 additions & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
},
"browserslist": [
"defaults",
"safari 15.6",
"ios_saf 15.6",
"> 0.25%",
"not ie 11",
"not op_mini all"
],
Expand Down Expand Up @@ -150,6 +153,7 @@
"@vitejs/plugin-react-swc": "^3.7.0",
"@vitest/coverage-istanbul": "1.6.0",
"autoprefixer": "10.4.19",
"browserslist-to-esbuild": "^2.1.1",
"colors": "^1.4.0",
"css-mediaquery": "0.1.2",
"cypress": "13.12.0",
Expand Down
21 changes: 21 additions & 0 deletions web/pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion web/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
},
"transpileOnly": true
},
"include": ["vite.config.cts", "cypress.config.ts", "scripts", "geo", ".storybook"]
"include": ["vite.config.ts", "cypress.config.ts", "scripts", "geo", ".storybook"]
}
10 changes: 6 additions & 4 deletions web/vite.config.cts → web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import eslintPlugin from '@nabla/vite-plugin-eslint';
import { sentryVitePlugin, SentryVitePluginOptions } from '@sentry/vite-plugin';
import react from '@vitejs/plugin-react-swc';
import browserslistToEsbuild from 'browserslist-to-esbuild';
import { defineConfig } from 'vite';
import { ManifestOptions, VitePWA } from 'vite-plugin-pwa';
import tsconfigPaths from 'vite-tsconfig-paths';
Expand Down Expand Up @@ -149,6 +150,7 @@ export default defineConfig(({ mode }) => ({
},
server: { host: '127.0.0.1' },
build: {
target: browserslistToEsbuild(),
sourcemap: true,
rollupOptions: {
output: {
Expand Down Expand Up @@ -193,8 +195,9 @@ export default defineConfig(({ mode }) => ({
],
}
),
...(mode !== 'test'
? [
...(mode === 'test'
? []
: [
eslintPlugin(),
VitePWA({
registerType: 'prompt',
Expand Down Expand Up @@ -228,7 +231,6 @@ export default defineConfig(({ mode }) => ({
}),
// Used to upload sourcemaps to Sentry
process.env.SENTRY_AUTH_TOKEN && sentryVitePlugin(sentryPluginOptions),
]
: []),
]),
],
}));

0 comments on commit 52c1362

Please sign in to comment.