File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
packages/plugin-legacy/src Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -176,17 +176,19 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
176176 config . build . cssTarget = 'chrome61'
177177 }
178178
179- // Vite's default target browsers are **not** the same.
180- // See https://github.com/vitejs/vite/pull/10052#issuecomment-1242076461
181- overriddenBuildTarget = config . build . target !== undefined
182- // browsers supporting ESM + dynamic import + import.meta
183- config . build . target = [
184- 'es2020' ,
185- 'edge79' ,
186- 'firefox67' ,
187- 'chrome64' ,
188- 'safari11.1'
189- ]
179+ if ( genLegacy ) {
180+ // Vite's default target browsers are **not** the same.
181+ // See https://github.com/vitejs/vite/pull/10052#issuecomment-1242076461
182+ overriddenBuildTarget = config . build . target !== undefined
183+ // browsers supporting ESM + dynamic import + import.meta
184+ config . build . target = [
185+ 'es2020' ,
186+ 'edge79' ,
187+ 'firefox67' ,
188+ 'chrome64' ,
189+ 'safari11.1'
190+ ]
191+ }
190192 }
191193
192194 return {
You can’t perform that action at this time.
0 commit comments