-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Closed
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)plugin: legacy
Description
- Read the docs.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- This is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
Describe the bug
@vitejs/plugin-legacy
does not use browserlist config files. When the targets
option is not specified, it is defaulted to defaults
, which means @babel/present-env
will use that target rather than .browserslistrc
.
Reproduction
import { defineConfig } from 'vite'
import legacy from '@vitejs/plugin-legacy'
export default defineConfig({
plugins: [legacy()]
})
System Info
vite
version: 2.0.5- Operating System: macOS 11.2.2
- Node version: 14.16.0
- Package manager (npm/yarn/pnpm) and version: yarn 1.22.10
Logs (Optional if provided reproduction)
With no targets option
[@vitejs/plugin-legacy] legacy polyfills: Set(95) {
'core-js/modules/es.symbol.js',
'core-js/modules/es.symbol.description.js',
'core-js/modules/es.object.to-string.js',
'core-js/modules/es.symbol.iterator.js',
'core-js/modules/es.string.iterator.js',
'core-js/modules/es.array.iterator.js',
'core-js/modules/web.dom-collections.iterator.js',
'core-js/modules/es.symbol.async-iterator.js',
'core-js/modules/es.symbol.to-string-tag.js',
'core-js/modules/es.math.to-string-tag.js',
'core-js/modules/es.json.to-string-tag.js',
'core-js/modules/es.object.get-prototype-of.js',
'core-js/modules/es.function.name.js',
'core-js/modules/es.promise.js',
'core-js/modules/es.regexp.to-string.js',
'core-js/modules/web.dom-collections.for-each.js',
'core-js/modules/es.array.slice.js',
'core-js/modules/es.number.constructor.js',
'core-js/modules/es.number.to-fixed.js',
'core-js/modules/es.array.join.js',
'core-js/modules/es.array.map.js',
'core-js/modules/es.array.filter.js',
'core-js/modules/es.string.split.js',
'core-js/modules/es.regexp.exec.js',
'core-js/modules/es.array.splice.js',
'core-js/modules/es.object.assign.js',
'core-js/modules/es.object.get-own-property-descriptor.js',
'core-js/modules/es.array.concat.js',
'core-js/modules/es.weak-set.js',
'core-js/modules/es.string.replace.js',
'core-js/modules/web.url.to-json.js',
'core-js/modules/es.object.keys.js',
'core-js/modules/esnext.global-this.js',
'core-js/modules/es.regexp.constructor.js',
'core-js/modules/es.array.includes.js',
'core-js/modules/es.string.includes.js',
'regenerator-runtime/runtime.js',
'core-js/modules/es.object.get-own-property-descriptors.js',
'core-js/modules/web.url.js',
'core-js/modules/es.string.search.js',
'core-js/modules/es.string.match.js',
'core-js/modules/es.string.trim.js',
'core-js/modules/es.array.find.js',
'core-js/modules/es.array.reduce.js',
'core-js/modules/es.set.js',
'core-js/modules/es.string.sub.js',
'core-js/modules/es.array.from.js',
'core-js/modules/es.map.js',
'core-js/modules/es.string.starts-with.js',
'core-js/modules/es.string.ends-with.js',
'core-js/modules/es.weak-map.js',
'core-js/modules/es.string.pad-start.js',
'core-js/modules/es.object.values.js',
'core-js/modules/es.array.find-index.js',
'core-js/modules/es.number.epsilon.js',
'core-js/modules/es.object.get-own-property-names.js',
'core-js/modules/es.object.is.js',
'core-js/modules/es.object.freeze.js',
'core-js/modules/es.typed-array.uint32-array.js',
'core-js/modules/es.typed-array.copy-within.js',
'core-js/modules/es.typed-array.every.js',
'core-js/modules/es.typed-array.fill.js',
'core-js/modules/es.typed-array.filter.js',
'core-js/modules/es.typed-array.find.js',
'core-js/modules/es.typed-array.find-index.js',
'core-js/modules/es.typed-array.for-each.js',
'core-js/modules/es.typed-array.includes.js',
'core-js/modules/es.typed-array.index-of.js',
'core-js/modules/es.typed-array.iterator.js',
'core-js/modules/es.typed-array.join.js',
'core-js/modules/es.typed-array.last-index-of.js',
'core-js/modules/es.typed-array.map.js',
'core-js/modules/es.typed-array.reduce.js',
'core-js/modules/es.typed-array.reduce-right.js',
'core-js/modules/es.typed-array.reverse.js',
'core-js/modules/es.typed-array.set.js',
'core-js/modules/es.typed-array.slice.js',
'core-js/modules/es.typed-array.some.js',
'core-js/modules/es.typed-array.sort.js',
'core-js/modules/es.typed-array.subarray.js',
'core-js/modules/es.typed-array.to-locale-string.js',
'core-js/modules/es.typed-array.to-string.js',
'core-js/modules/es.object.is-frozen.js',
'core-js/modules/es.reflect.own-keys.js',
'core-js/modules/es.reflect.get-own-property-descriptor.js',
'core-js/modules/es.string.link.js',
'core-js/modules/es.array-buffer.constructor.js',
'core-js/modules/es.reflect.construct.js',
'core-js/modules/es.promise.finally.js',
'core-js/modules/es.array.flat-map.js',
'core-js/modules/es.array.unscopables.flat-map.js',
'core-js/modules/es.math.sinh.js',
'core-js/modules/es.math.cosh.js',
'core-js/modules/es.string.repeat.js',
'core-js/modules/es.typed-array.float32-array.js'
}
With targets set to same value as in my .browserslistrc (>0.2%, not dead, not op_mini all)
[@vitejs/plugin-legacy] legacy polyfills: Set(101) {
'core-js/modules/es.symbol.js',
'core-js/modules/es.symbol.description.js',
'core-js/modules/es.object.to-string.js',
'core-js/modules/es.symbol.iterator.js',
'core-js/modules/es.string.iterator.js',
'core-js/modules/es.array.iterator.js',
'core-js/modules/web.dom-collections.iterator.js',
'core-js/modules/es.symbol.async-iterator.js',
'core-js/modules/es.symbol.to-string-tag.js',
'core-js/modules/es.math.to-string-tag.js',
'core-js/modules/es.json.to-string-tag.js',
'core-js/modules/es.object.get-prototype-of.js',
'core-js/modules/es.function.name.js',
'core-js/modules/es.promise.js',
'core-js/modules/es.regexp.to-string.js',
'core-js/modules/web.dom-collections.for-each.js',
'core-js/modules/es.array.reverse.js',
'core-js/modules/es.array.slice.js',
'core-js/modules/es.number.constructor.js',
'core-js/modules/es.number.to-fixed.js',
'core-js/modules/es.array.join.js',
'core-js/modules/es.array.map.js',
'core-js/modules/es.array.filter.js',
'core-js/modules/es.array.sort.js',
'core-js/modules/es.string.split.js',
'core-js/modules/es.regexp.exec.js',
'core-js/modules/es.array.index-of.js',
'core-js/modules/es.array.splice.js',
'core-js/modules/es.object.assign.js',
'core-js/modules/es.object.get-own-property-descriptor.js',
'core-js/modules/es.array.concat.js',
'core-js/modules/es.weak-set.js',
'core-js/modules/es.string.replace.js',
'core-js/modules/es.date.to-json.js',
'core-js/modules/web.url.to-json.js',
'core-js/modules/es.object.keys.js',
'core-js/modules/esnext.global-this.js',
'core-js/modules/es.regexp.constructor.js',
'core-js/modules/es.array.includes.js',
'core-js/modules/es.string.includes.js',
'regenerator-runtime/runtime.js',
'core-js/modules/es.object.get-own-property-descriptors.js',
'core-js/modules/web.url.js',
'core-js/modules/es.string.search.js',
'core-js/modules/es.string.match.js',
'core-js/modules/es.string.trim.js',
'core-js/modules/es.array.find.js',
'core-js/modules/es.array.reduce.js',
'core-js/modules/es.set.js',
'core-js/modules/es.string.sub.js',
'core-js/modules/es.array.from.js',
'core-js/modules/es.map.js',
'core-js/modules/es.string.starts-with.js',
'core-js/modules/es.string.ends-with.js',
'core-js/modules/es.array.last-index-of.js',
'core-js/modules/es.weak-map.js',
'core-js/modules/es.string.pad-start.js',
'core-js/modules/es.object.values.js',
'core-js/modules/es.array.find-index.js',
'core-js/modules/es.number.epsilon.js',
'core-js/modules/es.object.get-own-property-names.js',
'core-js/modules/es.object.is.js',
'core-js/modules/es.object.freeze.js',
'core-js/modules/es.typed-array.uint32-array.js',
'core-js/modules/es.typed-array.copy-within.js',
'core-js/modules/es.typed-array.every.js',
'core-js/modules/es.typed-array.fill.js',
'core-js/modules/es.typed-array.filter.js',
'core-js/modules/es.typed-array.find.js',
'core-js/modules/es.typed-array.find-index.js',
'core-js/modules/es.typed-array.for-each.js',
'core-js/modules/es.typed-array.includes.js',
'core-js/modules/es.typed-array.index-of.js',
'core-js/modules/es.typed-array.iterator.js',
'core-js/modules/es.typed-array.join.js',
'core-js/modules/es.typed-array.last-index-of.js',
'core-js/modules/es.typed-array.map.js',
'core-js/modules/es.typed-array.reduce.js',
'core-js/modules/es.typed-array.reduce-right.js',
'core-js/modules/es.typed-array.reverse.js',
'core-js/modules/es.typed-array.set.js',
'core-js/modules/es.typed-array.slice.js',
'core-js/modules/es.typed-array.some.js',
'core-js/modules/es.typed-array.sort.js',
'core-js/modules/es.typed-array.subarray.js',
'core-js/modules/es.typed-array.to-locale-string.js',
'core-js/modules/es.typed-array.to-string.js',
'core-js/modules/es.array-buffer.slice.js',
'core-js/modules/es.object.is-frozen.js',
'core-js/modules/es.reflect.own-keys.js',
'core-js/modules/es.reflect.get-own-property-descriptor.js',
'core-js/modules/es.string.link.js',
'core-js/modules/es.array-buffer.constructor.js',
'core-js/modules/es.reflect.construct.js',
'core-js/modules/es.promise.finally.js',
'core-js/modules/es.array.flat-map.js',
'core-js/modules/es.array.unscopables.flat-map.js',
'core-js/modules/es.math.sinh.js',
'core-js/modules/es.math.cosh.js',
'core-js/modules/es.string.repeat.js',
'core-js/modules/es.typed-array.float32-array.js'
}
Eazymov, thasmo, htmlin, fwh1990, d1y and 5 more
Metadata
Metadata
Assignees
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)plugin: legacy
Type
Projects
Status
Changes Requested