Closed Manish3323 closed 2 years ago
Adding this mode will start server in the specified (TESTING) mode, eventually users using this plugin will be able to define vite config based on this mode..
This will allow people to configure vite based on TESTING mode.
export default defineConfig(async ({ mode }) => { console.log('****************' + mode + '*********') const testDeps = mode === 'TESTING' ? [ '@testing-library/react', '@testing-library/user-event', 'chai', 'ts-mockito', '@testing-library/react-hooks/dom' ] : [] return { server: { port: 9000 }, base: `./`, optimizeDeps: { include: testDeps }, build: { outDir: AppConfig.applicationName, sourcemap: 'inline', rollupOptions: { input: ['./index.html'] } }, plugins: [reactRefresh()] } })
Also, this will explain in detail.
closing this as WEB_TEST_RUNNER sets NODE_ENV = test which can be used also..
Adding this mode will start server in the specified (TESTING) mode, eventually users using this plugin will be able to define vite config based on this mode..
This will allow people to configure vite based on TESTING mode.