Closed sancelot closed 1 year ago
Vite doesn't support browserlists out of the box it seems. I believe your workaround is indeed the correct solution. See: https://github.com/vitejs/vite/discussions/6849
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
I made a react application using nx monorepo. this application implements dynamic webworker creation and webworker in libs.
This works fine, but I need my application to work with chrome >= 69 (electron 4.2.12 https://github.com/electron/releases)
I tried using browserslist feature, but the browser is unable to load the built scripts.
Expected Behavior
My application should work if I specify chrome >= 69 in .browserslistrc file in the APP folder as described here https://nx.dev/recipes/other/browser-support
GitHub Repo
No response
Steps to Reproduce
4.Build the application
Nx Report
Failure Logs
No response
Additional Information
But I managed to be able to run it with chrome 69 using another way . I don't think it is the right way to do it with nx.dev:
import legacy from '@vitejs/plugin-legacy';
export default defineConfig({ build: { target: 'es2015', }, cacheDir: '../../node_modules/.vite/my-app',
server: { port: 4200, host: '0.0.0.0', },
preview: { port: 4300, host: '0.0.0.0', },
plugins: [ react(), viteTsConfigPaths({ root: '../../', }), // For production build environments only legacy({ targets: [ 'chrome >= 69', 'edge >= 79', 'safari >= 11.1', 'firefox >= 67', ], }), ],
test: { globals: true, cache: { dir: '../../node_modules/.vitest', }, environment: 'jsdom', include: ['src/*/.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], }, });