@vitejs/plugin-legacy 1.6.4 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -165,7 +165,9 @@ The legacy plugin requires inline scripts for [Safari 10.1 `nomodule` fix](https
165
165
 
166
166
  - `sha256-MS6/3FCg4WjP9gwgaBGwLpRCY6fZBgwmhVCdrPrNf3E=`
167
167
  - `sha256-tQjf8gvb2ROOMapIxFvFAYBeUJ0v1HCbOcSmDNXGtDo=`
168
- - `sha256-T9h4ixy0FtNsCwAyTfBtIY6uV5ZhMeNQIlL42GAKEME=`
168
+ - `sha256-xYj09txJ9OsgySe5ommpqul6FiaJZRrwe3KTD7wbV6w=`
169
+ - `sha256-4m6wOIrq/wFDmi9Xh3mFM2mwI4ik9n3TMgHk6xDtLxk=`
170
+ - `sha256-uS7/g9fhQwNZS1f/MqYqqKv8y9hCu36IfX9XZB5L7YY=`
169
171
 
170
172
  These values (without the `sha256-` prefix) can also be retrieved via
171
173
 
@@ -173,6 +175,8 @@ These values (without the `sha256-` prefix) can also be retrieved via
173
175
  const { cspHashes } = require('@vitejs/plugin-legacy')
174
176
  ```
175
177
 
178
+ When using the `regenerator-runtime` polyfill, it will attempt to use the `globalThis` object to register itself. If `globalThis` is not available (it is [fairly new](https://caniuse.com/?search=globalThis) and not widely supported, including IE 11), it attempts to perform dynamic `Function(...)` call which violates the CSP. To avoid dynamic `eval` in the absence of `globalThis` consider adding `core-js/proposals/global-this` to `additionalLegacyPolyfills` to define it.
179
+
176
180
  ## References
177
181
 
178
182
  - [Vue CLI modern mode](https://cli.vuejs.org/guide/browser-compatibility.html#modern-mode)
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Plugin } from 'vite'
1
+ import type { Plugin } from 'vite'
2
2
 
3
3
  export interface Options {
4
4
  /**
package/index.js CHANGED
@@ -18,7 +18,11 @@ const safari10NoModuleFix = `!function(){var e=document,t=e.createElement("scrip
18
18
  const legacyPolyfillId = 'vite-legacy-polyfill'
19
19
  const legacyEntryId = 'vite-legacy-entry'
20
20
  const systemJSInlineCode = `System.import(document.getElementById('${legacyEntryId}').getAttribute('data-src'))`
21
- const dynamicFallbackInlineCode = `!function(){try{new Function("m","return import(m)")}catch(o){console.warn("vite: loading legacy build because dynamic import is unsupported, syntax error above should be ignored");var e=document.getElementById("${legacyPolyfillId}"),n=document.createElement("script");n.src=e.src,n.onload=function(){${systemJSInlineCode}},document.body.appendChild(n)}}();`
21
+
22
+ const detectDynamicImportVarName = '__vite_is_dynamic_import_support'
23
+ const detectDynamicImportVarInitCode = `var ${detectDynamicImportVarName}=false;`
24
+ const detectDynamicImportCode = `try{import("_").catch(()=>1);}catch(e){}window.${detectDynamicImportVarName}=true;`
25
+ const dynamicFallbackInlineCode = `!function(){if(window.${detectDynamicImportVarName})return;console.warn("vite: loading legacy build because dynamic import is unsupported, syntax error above should be ignored");var e=document.getElementById("${legacyPolyfillId}"),n=document.createElement("script");n.src=e.src,n.onload=function(){${systemJSInlineCode}},document.body.appendChild(n)}();`
22
26
 
23
27
  const forceDynamicImportUsage = `export function __vite_legacy_guard(){import('data:text/javascript,')};`
24
28
 
@@ -37,8 +41,9 @@ function viteLegacyPlugin(options = {}) {
37
41
  const genLegacy = options.renderLegacyChunks !== false
38
42
  const genDynamicFallback = genLegacy
39
43
 
40
- const debugFlag = process.env.DEBUG
41
- const isDebug = debugFlag === 'vite:*' || debugFlag === 'vite:legacy'
44
+ const debugFlags = (process.env.DEBUG || '').split(',')
45
+ const isDebug =
46
+ debugFlags.includes('vite:*') || debugFlags.includes('vite:legacy')
42
47
 
43
48
  const facadeToLegacyChunkMap = new Map()
44
49
  const facadeToLegacyPolyfillMap = new Map()
@@ -105,23 +110,6 @@ function viteLegacyPlugin(options = {}) {
105
110
  name: 'vite:legacy-generate-polyfill-chunk',
106
111
  apply: 'build',
107
112
 
108
- config() {
109
- return {
110
- build: {
111
- minify: 'terser'
112
- }
113
- }
114
- },
115
-
116
- configResolved(config) {
117
- if (!config.build.ssr && genLegacy && config.build.minify === 'esbuild') {
118
- throw new Error(
119
- `Can't use esbuild as the minifier when targeting legacy browsers ` +
120
- `because esbuild minification is not legacy safe.`
121
- )
122
- }
123
- },
124
-
125
113
  async generateBundle(opts, bundle) {
126
114
  if (config.build.ssr) {
127
115
  return
@@ -297,6 +285,19 @@ function viteLegacyPlugin(options = {}) {
297
285
  // legacy-unsafe code - e.g. rewriting object properties into shorthands
298
286
  opts.__vite_skip_esbuild__ = true
299
287
 
288
+ // @ts-ignore force terser for legacy chunks. This only takes effect if
289
+ // minification isn't disabled, because that leaves out the terser plugin
290
+ // entirely.
291
+ opts.__vite_force_terser__ = true
292
+
293
+ // @ts-ignore
294
+ // In the `generateBundle` hook,
295
+ // we'll delete the assets from the legacy bundle to avoid emitting duplicate assets.
296
+ // But that's still a waste of computing resource.
297
+ // So we add this flag to avoid emitting the asset in the first place whenever possible.
298
+ opts.__vite_skip_asset_emit__ = true
299
+
300
+ // @ts-ignore avoid emitting assets for legacy bundle
300
301
  const needPolyfills =
301
302
  options.polyfills !== false && !Array.isArray(options.polyfills)
302
303
 
@@ -329,7 +330,10 @@ function viteLegacyPlugin(options = {}) {
329
330
  loose: false,
330
331
  useBuiltIns: needPolyfills ? 'usage' : false,
331
332
  corejs: needPolyfills
332
- ? { version: 3, proposals: false }
333
+ ? {
334
+ version: require('core-js/package.json').version,
335
+ proposals: false
336
+ }
333
337
  : undefined,
334
338
  shippedProposals: true,
335
339
  ignoreBrowserslistConfig: options.ignoreBrowserslistConfig
@@ -433,6 +437,18 @@ function viteLegacyPlugin(options = {}) {
433
437
 
434
438
  // 5. inject dynamic import fallback entry
435
439
  if (genDynamicFallback && legacyPolyfillFilename && legacyEntryFilename) {
440
+ tags.push({
441
+ tag: 'script',
442
+ attrs: { type: 'module' },
443
+ children: detectDynamicImportVarInitCode,
444
+ injectTo: 'head'
445
+ })
446
+ tags.push({
447
+ tag: 'script',
448
+ attrs: { type: 'module' },
449
+ children: detectDynamicImportCode,
450
+ injectTo: 'head'
451
+ })
436
452
  tags.push({
437
453
  tag: 'script',
438
454
  attrs: { type: 'module' },
@@ -698,5 +714,7 @@ viteLegacyPlugin.default = viteLegacyPlugin
698
714
  viteLegacyPlugin.cspHashes = [
699
715
  createHash('sha256').update(safari10NoModuleFix).digest('base64'),
700
716
  createHash('sha256').update(systemJSInlineCode).digest('base64'),
717
+ createHash('sha256').update(detectDynamicImportVarInitCode).digest('base64'),
718
+ createHash('sha256').update(detectDynamicImportCode).digest('base64'),
701
719
  createHash('sha256').update(dynamicFallbackInlineCode).digest('base64')
702
720
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitejs/plugin-legacy",
3
- "version": "1.6.4",
3
+ "version": "1.8.0",
4
4
  "license": "MIT",
5
5
  "author": "Evan You",
6
6
  "files": [
@@ -9,10 +9,6 @@
9
9
  ],
10
10
  "main": "index.js",
11
11
  "types": "index.d.ts",
12
- "scripts": {
13
- "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path . --lerna-package plugin-legacy",
14
- "release": "node ../../scripts/release.cjs --skipBuild"
15
- },
16
12
  "engines": {
17
13
  "node": ">=12.0.0"
18
14
  },
@@ -26,13 +22,13 @@
26
22
  },
27
23
  "homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-legacy#readme",
28
24
  "dependencies": {
29
- "@babel/standalone": "^7.16.4",
30
- "core-js": "^3.19.1",
31
- "magic-string": "^0.25.7",
25
+ "@babel/standalone": "^7.17.8",
26
+ "core-js": "^3.21.1",
27
+ "magic-string": "^0.26.1",
32
28
  "regenerator-runtime": "^0.13.9",
33
- "systemjs": "^6.11.0"
29
+ "systemjs": "^6.12.1"
34
30
  },
35
31
  "peerDependencies": {
36
- "vite": "^2.0.0"
32
+ "vite": "^2.8.0"
37
33
  }
38
34
  }
package/CHANGELOG.md DELETED
@@ -1,273 +0,0 @@
1
- ## [1.6.4](https://github.com/vitejs/vite/compare/plugin-legacy@1.6.3...plugin-legacy@1.6.4) (2021-12-07)
2
-
3
-
4
-
5
- ## [1.6.3](https://github.com/vitejs/vite/compare/plugin-legacy@1.6.2...plugin-legacy@1.6.3) (2021-11-22)
6
-
7
-
8
- ### Bug Fixes
9
-
10
- * **build:** resolve `rollupOptions.input` paths ([#5601](https://github.com/vitejs/vite/issues/5601)) ([5b6b016](https://github.com/vitejs/vite/commit/5b6b01693720290e8998b2613f0dcb2d699ee84f))
11
-
12
-
13
-
14
- ## [1.6.2](https://github.com/vitejs/vite/compare/plugin-legacy@1.6.1...plugin-legacy@1.6.2) (2021-10-11)
15
-
16
-
17
- ### Features
18
-
19
- * add `build.cssTarget` option ([#5132](https://github.com/vitejs/vite/issues/5132)) ([b17444f](https://github.com/vitejs/vite/commit/b17444fd97b02bc54410c8575e7d3cb25e4058c2)), closes [#4746](https://github.com/vitejs/vite/issues/4746) [#5070](https://github.com/vitejs/vite/issues/5070) [#4930](https://github.com/vitejs/vite/issues/4930)
20
-
21
-
22
-
23
- ## [1.6.1](https://github.com/vitejs/vite/compare/plugin-legacy@1.6.0...plugin-legacy@1.6.1) (2021-10-05)
24
-
25
-
26
- ### Bug Fixes
27
-
28
- * **plugin-legacy:** use terser as the default minifier ([#5168](https://github.com/vitejs/vite/issues/5168)) ([9ee7234](https://github.com/vitejs/vite/commit/9ee72343884a7d679767833f7a659bbca6b96595))
29
-
30
-
31
-
32
- # [1.6.0](https://github.com/vitejs/vite/compare/plugin-legacy@1.5.3...plugin-legacy@1.6.0) (2021-09-29)
33
-
34
-
35
- ### Bug Fixes
36
-
37
- * **deps:** update all non-major dependencies ([#4545](https://github.com/vitejs/vite/issues/4545)) ([a44fd5d](https://github.com/vitejs/vite/commit/a44fd5d38679da0be2536103e83af730cda73a95))
38
- * esbuild minification and renderLegacyChunks false ([#5054](https://github.com/vitejs/vite/issues/5054)) ([ed384cf](https://github.com/vitejs/vite/commit/ed384cfeff9e3ccb0fdbb07ec91758308da66226))
39
- * normalize internal plugin names ([#4976](https://github.com/vitejs/vite/issues/4976)) ([37f0b2f](https://github.com/vitejs/vite/commit/37f0b2fff74109d381513ed052a32b43655ee11d))
40
- * **plugin-legacy:** fix type errors ([#4762](https://github.com/vitejs/vite/issues/4762)) ([5491143](https://github.com/vitejs/vite/commit/5491143be0b4214d2dab91076a85739d6d106481))
41
-
42
-
43
- ### Features
44
-
45
- * **plugin-legacy:** add externalSystemJS option ([#5024](https://github.com/vitejs/vite/issues/5024)) ([60b6f55](https://github.com/vitejs/vite/commit/60b6f5595a00cbf014a30d57721081eb79436a97))
46
-
47
-
48
-
49
- ## [1.5.3](https://github.com/vitejs/vite/compare/plugin-legacy@1.5.2...plugin-legacy@1.5.3) (2021-09-07)
50
-
51
-
52
- ### Bug Fixes
53
-
54
- * **plugin-legacy:** fix regression introduced in [#4536](https://github.com/vitejs/vite/issues/4536) ([#4861](https://github.com/vitejs/vite/issues/4861)) ([fdc3212](https://github.com/vitejs/vite/commit/fdc3212474ff951e7e67810eca6cfb3ef1ed9ea2))
55
- * **plugin-legacy:** skip in SSR build ([#4536](https://github.com/vitejs/vite/issues/4536)) ([1f068fc](https://github.com/vitejs/vite/commit/1f068fcec38fc07c34e75a19821064386e460907))
56
-
57
-
58
-
59
- ## [1.5.2](https://github.com/vitejs/vite/compare/plugin-legacy@1.5.1...plugin-legacy@1.5.2) (2021-09-01)
60
-
61
-
62
- ### Bug Fixes
63
-
64
- * **plugin-legacy:** avoid executing blank dynamic import ([#4767](https://github.com/vitejs/vite/issues/4767)) ([de71408](https://github.com/vitejs/vite/commit/de7140853140029a3f48600b60e700464e7662b5)), closes [#4568](https://github.com/vitejs/vite/issues/4568)
65
-
66
-
67
-
68
- ## [1.5.1](https://github.com/vitejs/vite/compare/plugin-legacy@1.5.0...plugin-legacy@1.5.1) (2021-08-03)
69
-
70
-
71
- ### Bug Fixes
72
-
73
- * **deps:** update all non-major dependencies ([#4468](https://github.com/vitejs/vite/issues/4468)) ([cd54a22](https://github.com/vitejs/vite/commit/cd54a22b8d5048f5d25a9954697f49b6d65dcc1f))
74
- * **plugin-legacy:** bake-in Promise polyfill, fix [#4414](https://github.com/vitejs/vite/issues/4414) ([#4440](https://github.com/vitejs/vite/issues/4440)) ([024a2de](https://github.com/vitejs/vite/commit/024a2de63df60a4037f9f7b13a0bc6e2b0d41fb6))
75
-
76
-
77
-
78
- # [1.5.0](https://github.com/vitejs/vite/compare/plugin-legacy@1.4.4...plugin-legacy@1.5.0) (2021-07-27)
79
-
80
-
81
- ### Bug Fixes
82
-
83
- * **deps:** update all non-major dependencies ([#4387](https://github.com/vitejs/vite/issues/4387)) ([2f900ba](https://github.com/vitejs/vite/commit/2f900ba4d4ad8061e0046898e8d1de3129e7f784))
84
- * **plugin-legacy:** legacy fallback for dynamic import ([#3885](https://github.com/vitejs/vite/issues/3885)) ([fc6d8f1](https://github.com/vitejs/vite/commit/fc6d8f1d3efe836f17f3c45375dd3749128b8137))
85
-
86
-
87
-
88
- ## [1.4.4](https://github.com/vitejs/vite/compare/plugin-legacy@1.4.3...plugin-legacy@1.4.4) (2021-07-12)
89
-
90
-
91
- ### Features
92
-
93
- * allow entryFileNames, chunkFileNames functions for legacy ([#4122](https://github.com/vitejs/vite/issues/4122)) ([df29bff](https://github.com/vitejs/vite/commit/df29bfff44ad7f2e822f92935d0ca9c99f15b67e))
94
-
95
-
96
-
97
- ## [1.4.3](https://github.com/vitejs/vite/compare/plugin-legacy@1.4.2...plugin-legacy@1.4.3) (2021-06-27)
98
-
99
-
100
- ### Bug Fixes
101
-
102
- * don't force polyfillDynamicImport if renderLegacyChunks is false ([#3695](https://github.com/vitejs/vite/issues/3695)) ([#3774](https://github.com/vitejs/vite/issues/3774)) ([d2a51ca](https://github.com/vitejs/vite/commit/d2a51ca4eda2ca9f99d9a066836d76d2253cfc24))
103
- * **deps:** update all non-major dependencies ([#3878](https://github.com/vitejs/vite/issues/3878)) ([a66a805](https://github.com/vitejs/vite/commit/a66a8053e9520d20bcf95fce870570c5195bcc91))
104
- * **plugin-legacy:** chunk may not exist ([#3886](https://github.com/vitejs/vite/issues/3886)) ([dd5931d](https://github.com/vitejs/vite/commit/dd5931d9c1cf382849047332b2c3409755ceebf5))
105
-
106
-
107
-
108
- ## [1.4.2](https://github.com/vitejs/vite/compare/plugin-legacy@1.4.1...plugin-legacy@1.4.2) (2021-06-22)
109
-
110
-
111
- ### Bug Fixes
112
-
113
- * **deps:** update all non-major dependencies ([#3791](https://github.com/vitejs/vite/issues/3791)) ([74d409e](https://github.com/vitejs/vite/commit/74d409eafca8d74ec4a6ece621ea2895bc1f2a32))
114
- * **plugin-legacy:** wrap chunks in IIFE ([#3783](https://github.com/vitejs/vite/issues/3783)) ([9abdb81](https://github.com/vitejs/vite/commit/9abdb8137ef54dd095e7bc47ae6a1ccf490fd196))
115
-
116
-
117
-
118
- ## [1.4.1](https://github.com/vitejs/vite/compare/plugin-legacy@1.4.0...plugin-legacy@1.4.1) (2021-06-01)
119
-
120
-
121
- ### Bug Fixes
122
-
123
- * **plugin-legacy:** respect custom filenames formats, fix [#2356](https://github.com/vitejs/vite/issues/2356) ([#2641](https://github.com/vitejs/vite/issues/2641)) ([d852731](https://github.com/vitejs/vite/commit/d852731622a1c009d15a5172343fc166c4bb5cb7))
124
-
125
-
126
-
127
- # [1.4.0](https://github.com/vitejs/vite/compare/plugin-legacy@1.3.4...plugin-legacy@1.4.0) (2021-05-17)
128
-
129
-
130
- ### Bug Fixes
131
-
132
- * **plugin-legacy:** turn off babel loose mode ([#3406](https://github.com/vitejs/vite/issues/3406)) ([5348c02](https://github.com/vitejs/vite/commit/5348c02f58bde36c412dbfe36c3ad37772bf83e5))
133
- * restore dynamic-import-polyfill ([#3434](https://github.com/vitejs/vite/issues/3434)) ([4112c5d](https://github.com/vitejs/vite/commit/4112c5d103673b83c50d446096086617dfaac5a3))
134
-
135
-
136
-
137
- ## [1.3.4](https://github.com/vitejs/vite/compare/plugin-legacy@1.3.3...plugin-legacy@1.3.4) (2021-05-11)
138
-
139
-
140
- ### Bug Fixes
141
-
142
- * **plugin-legacy:** move polyfills in plugin post, fixes [#2786](https://github.com/vitejs/vite/issues/2786) and [#2781](https://github.com/vitejs/vite/issues/2781) ([#3023](https://github.com/vitejs/vite/issues/3023)) ([43150e3](https://github.com/vitejs/vite/commit/43150e352d164744e2fda766927053439bdf7db9))
143
- * **plugin-legacy:** require Vite 2.0.0 final ([#3265](https://github.com/vitejs/vite/issues/3265)) ([e395dee](https://github.com/vitejs/vite/commit/e395deeb0f11ebb1bcebe69233adebaad10f77eb))
144
-
145
-
146
-
147
- ## [1.3.3](https://github.com/vitejs/vite/compare/plugin-legacy@1.3.2...plugin-legacy@1.3.3) (2021-05-03)
148
-
149
-
150
- ### Bug Fixes
151
-
152
- * **plugin-legacy:** correct log level to error ([#3241](https://github.com/vitejs/vite/issues/3241)) ([474fe9a](https://github.com/vitejs/vite/commit/474fe9a3abbdf4845447eaab821d2ba51fda6207))
153
- * ignore babelrc in legacy plugin ([#2801](https://github.com/vitejs/vite/issues/2801)) ([d466ad0](https://github.com/vitejs/vite/commit/d466ad0a095859a895fd4cb85f425ad4c4583e4e))
154
-
155
-
156
-
157
- ## [1.3.2](https://github.com/vitejs/vite/compare/plugin-legacy@1.3.1...plugin-legacy@1.3.2) (2021-03-27)
158
-
159
-
160
- ### Bug Fixes
161
-
162
- * typo in plugin-legacy ([#2651](https://github.com/vitejs/vite/issues/2651)) ([9a2ce75](https://github.com/vitejs/vite/commit/9a2ce7580772cb783a9f8fda7e45e4a9adacbec2))
163
-
164
-
165
-
166
- ## [1.3.1](https://github.com/vitejs/vite/compare/plugin-legacy@1.3.0...plugin-legacy@1.3.1) (2021-02-15)
167
-
168
-
169
- ### Bug Fixes
170
-
171
- * **plugin-legacy:** prevent constant folding for import.meta.env.LEGACY ([bace724](https://github.com/vitejs/vite/commit/bace7244e776b3f4c9dd7e3ff1885df668cbcb87)), closes [#1999](https://github.com/vitejs/vite/issues/1999)
172
- * **plugin-legacy:** use correct string length in legacy env replacement ([#2015](https://github.com/vitejs/vite/issues/2015)) ([7f48086](https://github.com/vitejs/vite/commit/7f4808634f57ca8f4be3b455cc4fb8016acdc4fd))
173
-
174
-
175
-
176
- # [1.3.0](https://github.com/vitejs/vite/compare/plugin-legacy@1.2.3...plugin-legacy@1.3.0) (2021-02-11)
177
-
178
-
179
- ### Features
180
-
181
- * **plugin-legacy:** inject import.meta.env.LEGACY ([416f190](https://github.com/vitejs/vite/commit/416f190aa92f06a06f3ded403fb1e4cb8729256d))
182
-
183
-
184
-
185
- ## [1.2.3](https://github.com/vitejs/vite/compare/plugin-legacy@1.2.2...plugin-legacy@1.2.3) (2021-02-01)
186
-
187
-
188
- ### Features
189
-
190
- * **plugin-legacy:** use compact output when transpiling legacy chunks ([045e519](https://github.com/vitejs/vite/commit/045e519d51fbce94bddb60793e9e99311acc5aa2)), closes [#1828](https://github.com/vitejs/vite/issues/1828)
191
-
192
-
193
-
194
- ## [1.2.2](https://github.com/vitejs/vite/compare/plugin-legacy@1.2.1...plugin-legacy@1.2.2) (2021-01-25)
195
-
196
-
197
- ### Bug Fixes
198
-
199
- * **plugin-legacy:** throw error when using esbuild minify with legacy plugin ([8fb2511](https://github.com/vitejs/vite/commit/8fb2511a02c163d85f60dfab0bef104756768e35))
200
-
201
-
202
- ### Features
203
-
204
- * default vendor chunk splitting ([f6b58a0](https://github.com/vitejs/vite/commit/f6b58a0f535b1c26f9c1dfda74c28c685402c3c9))
205
- * support `base` option during dev, deprecate `build.base` ([#1556](https://github.com/vitejs/vite/issues/1556)) ([809d4bd](https://github.com/vitejs/vite/commit/809d4bd3bf62d3bc6b35f182178922d2ab2175f1))
206
-
207
-
208
-
209
- ## [1.2.1](https://github.com/vitejs/vite/compare/plugin-legacy@1.2.0...plugin-legacy@1.2.1) (2021-01-14)
210
-
211
-
212
- ### Bug Fixes
213
-
214
- * **plugin-legacy:** respect config.build.assetsDir ([#1532](https://github.com/vitejs/vite/issues/1532)) ([3e7ad3f](https://github.com/vitejs/vite/commit/3e7ad3fa26a6149b44b2e522648cbda1009e4888)), closes [#1530](https://github.com/vitejs/vite/issues/1530)
215
-
216
-
217
-
218
- # [1.2.0](https://github.com/vitejs/vite/compare/plugin-legacy@1.1.1...plugin-legacy@1.2.0) (2021-01-11)
219
-
220
-
221
- ### Bug Fixes
222
-
223
- * **plugin-html:** typo in the Safari 10 nomodule snippet ([#1483](https://github.com/vitejs/vite/issues/1483)) ([e5576c3](https://github.com/vitejs/vite/commit/e5576c32c08214766c8bac5458dfcad8301d3a1a))
224
-
225
-
226
- ### Features
227
-
228
- * **plugin-legacy:** support additionalLegacyPolyfills ([ca25896](https://github.com/vitejs/vite/commit/ca258962957c32df0196f30267c3d77b544aacbd)), closes [#1475](https://github.com/vitejs/vite/issues/1475)
229
-
230
-
231
-
232
- ## [1.1.1](https://github.com/vitejs/vite/compare/plugin-legacy@1.1.0...plugin-legacy@1.1.1) (2021-01-09)
233
-
234
-
235
- ### Bug Fixes
236
-
237
- * **plugin-legacy:** add `index.d.ts` at publish ([#1457](https://github.com/vitejs/vite/issues/1457)) ([dce2456](https://github.com/vitejs/vite/commit/dce245629651edab9719127deaf07ecfbcf20c5f))
238
-
239
-
240
-
241
- # [1.1.0](https://github.com/vitejs/vite/compare/plugin-legacy@1.0.1...plugin-legacy@1.1.0) (2021-01-07)
242
-
243
-
244
- ### Features
245
-
246
- * use constant inline script + provide CSP hashes ([72107cd](https://github.com/vitejs/vite/commit/72107cdcdb7241e9fadd67528abb14f54b1c901d))
247
-
248
-
249
-
250
- ## [1.0.1](https://github.com/vitejs/vite/compare/plugin-legacy@1.0.0...plugin-legacy@1.0.1) (2021-01-07)
251
-
252
-
253
- ### Bug Fixes
254
-
255
- * **plugin-legacy:** avoid esbuild transform on legacy chunks ([7734105](https://github.com/vitejs/vite/commit/7734105093c6dabf64da6bfc11486aa9ac62efea))
256
- * add promise polyfill if not used in bundle ([b72db4e](https://github.com/vitejs/vite/commit/b72db4e3ec5ca8974ea2f1913d5611f73c0978b5))
257
-
258
-
259
- ### Performance Improvements
260
-
261
- * use @babel/standalone + lazy load ([b2f98fb](https://github.com/vitejs/vite/commit/b2f98fba0215ef171af2abc62e3aefc35f00d168))
262
-
263
-
264
-
265
- # 1.0.0 (2021-01-07)
266
-
267
-
268
- ### Features
269
-
270
- * **plugin-legacy:** @vitejs/plugin-legacy ([8c34870](https://github.com/vitejs/vite/commit/8c34870040f8c2f4be7d00245a3683f9e64d894e))
271
-
272
-
273
-