Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: use browserslist targets #6891

Merged
merged 9 commits into from
Jul 26, 2024
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'
? []
: [
Comment on lines +198 to +200
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is either ESLint or Prettiers doing but it should be fine.

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),
]
: []),
]),
],
}));
Loading