@vitejs/plugin-legacy
Advanced tools
Comparing version 1.6.4 to 1.7.0
@@ -0,1 +1,11 @@ | ||
# [1.7.0](https://github.com/vitejs/vite/compare/plugin-legacy@1.6.4...plugin-legacy@1.7.0) (2022-02-09) | ||
### Bug Fixes | ||
* don't force terser on non-legacy (fix [#6266](https://github.com/vitejs/vite/issues/6266)) ([#6272](https://github.com/vitejs/vite/issues/6272)) ([1da104e](https://github.com/vitejs/vite/commit/1da104e8597e2965313e8cd582d032bca551e4ee)) | ||
* **legacy:** fix conflict with the modern build on css emitting ([#6584](https://github.com/vitejs/vite/issues/6584)) ([f48255e](https://github.com/vitejs/vite/commit/f48255e6e0058e973b949fb4a2372974f0480e11)), closes [#3296](https://github.com/vitejs/vite/issues/3296) [#3317](https://github.com/vitejs/vite/issues/3317) [/github.com/vitejs/vite/commit/6bce1081991501f3779bff1a81e5dd1e63e5d38e#diff-2cfbd4f4d8c32727cd8e1a561cffbde0b384a3ce0789340440e144f9d64c10f6R262-R263](https://github.com//github.com/vitejs/vite/commit/6bce1081991501f3779bff1a81e5dd1e63e5d38e/issues/diff-2cfbd4f4d8c32727cd8e1a561cffbde0b384a3ce0789340440e144f9d64c10f6R262-R263) | ||
## [1.6.4](https://github.com/vitejs/vite/compare/plugin-legacy@1.6.3...plugin-legacy@1.6.4) (2021-12-07) | ||
@@ -2,0 +12,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { Plugin } from 'vite' | ||
import type { Plugin } from 'vite' | ||
@@ -3,0 +3,0 @@ export interface Options { |
35
index.js
@@ -40,4 +40,5 @@ // @ts-check | ||
const debugFlag = process.env.DEBUG | ||
const isDebug = debugFlag === 'vite:*' || debugFlag === 'vite:legacy' | ||
const debugFlags = (process.env.DEBUG || '').split(',') | ||
const isDebug = | ||
debugFlags.includes('vite:*') || debugFlags.includes('vite:legacy') | ||
@@ -109,19 +110,2 @@ const facadeToLegacyChunkMap = new Map() | ||
config() { | ||
return { | ||
build: { | ||
minify: 'terser' | ||
} | ||
} | ||
}, | ||
configResolved(config) { | ||
if (!config.build.ssr && genLegacy && config.build.minify === 'esbuild') { | ||
throw new Error( | ||
`Can't use esbuild as the minifier when targeting legacy browsers ` + | ||
`because esbuild minification is not legacy safe.` | ||
) | ||
} | ||
}, | ||
async generateBundle(opts, bundle) { | ||
@@ -302,2 +286,15 @@ if (config.build.ssr) { | ||
// @ts-ignore force terser for legacy chunks. This only takes effect if | ||
// minification isn't disabled, because that leaves out the terser plugin | ||
// entirely. | ||
opts.__vite_force_terser__ = true | ||
// @ts-ignore | ||
// In the `generateBundle` hook, | ||
// we'll delete the assets from the legacy bundle to avoid emitting duplicate assets. | ||
// But that's still a waste of computing resource. | ||
// So we add this flag to avoid emitting the asset in the first place whenever possible. | ||
opts.__vite_skip_asset_emit__ = true | ||
// @ts-ignore avoid emitting assets for legacy bundle | ||
const needPolyfills = | ||
@@ -304,0 +301,0 @@ options.polyfills !== false && !Array.isArray(options.polyfills) |
{ | ||
"name": "@vitejs/plugin-legacy", | ||
"version": "1.6.4", | ||
"version": "1.7.0", | ||
"license": "MIT", | ||
@@ -14,3 +14,3 @@ "author": "Evan You", | ||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path . --lerna-package plugin-legacy", | ||
"release": "node ../../scripts/release.cjs --skipBuild" | ||
"release": "ts-node ../../scripts/release.ts --skipBuild" | ||
}, | ||
@@ -30,11 +30,11 @@ "engines": { | ||
"dependencies": { | ||
"@babel/standalone": "^7.16.4", | ||
"core-js": "^3.19.1", | ||
"@babel/standalone": "^7.16.12", | ||
"core-js": "^3.20.3", | ||
"magic-string": "^0.25.7", | ||
"regenerator-runtime": "^0.13.9", | ||
"systemjs": "^6.11.0" | ||
"systemjs": "^6.12.1" | ||
}, | ||
"peerDependencies": { | ||
"vite": "^2.0.0" | ||
"vite": "^2.7.8" | ||
} | ||
} |
42360
659
Updated@babel/standalone@^7.16.12
Updatedcore-js@^3.20.3
Updatedsystemjs@^6.12.1