File tree 1 file changed +13
-11
lines changed
packages/plugin-legacy/src
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[] {
176
176
config . build . cssTarget = 'chrome61'
177
177
}
178
178
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
+ }
190
192
}
191
193
192
194
return {
You can’t perform that action at this time.
0 commit comments