fix(ct): viteConfig commonjsOptions doesn't work (#22063)

This commit is contained in:
Sander 2023-03-29 23:00:38 +02:00 committed by GitHub
parent 2428ff8b8b
commit 8d6f7ad521
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,9 +104,6 @@ export function createPlugin(
viteConfig.root = rootDir; viteConfig.root = rootDir;
viteConfig.preview = { port, ...viteConfig.preview }; viteConfig.preview = { port, ...viteConfig.preview };
viteConfig.build = {
outDir
};
// React heuristic. If we see a component in a file with .js extension, // React heuristic. If we see a component in a file with .js extension,
// consider it a potential JSX-in-JS scenario and enable JSX loader for all // consider it a potential JSX-in-JS scenario and enable JSX loader for all
@ -138,6 +135,7 @@ export function createPlugin(
viteConfig.css.devSourcemap = true; viteConfig.css.devSourcemap = true;
viteConfig.build = { viteConfig.build = {
...viteConfig.build, ...viteConfig.build,
outDir,
target: 'esnext', target: 'esnext',
minify: false, minify: false,
rollupOptions: { rollupOptions: {