@vitejs/plugin-legacy 4.0.1 → 4.0.2

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
@@ -159,8 +159,8 @@ The legacy plugin requires inline scripts for [Safari 10.1 `nomodule` fix](https
159
159
 
160
160
  - `sha256-MS6/3FCg4WjP9gwgaBGwLpRCY6fZBgwmhVCdrPrNf3E=`
161
161
  - `sha256-tQjf8gvb2ROOMapIxFvFAYBeUJ0v1HCbOcSmDNXGtDo=`
162
- - `sha256-BoFUHKsYhJ9tbsHugtNQCmnkBbZ11pcW6kZguu+T+EU=`
163
- - `sha256-A18HC3jLpyEc9B8oyxq/NBFCyFBJFSsRLt0gmT9kft8=`
162
+ - `sha256-p7PoC97FO+Lu90RNjGWxhbm13yALSR4xzV8vaDhaQBo=`
163
+ - `sha256-+5XkZFazzJo8n0iOP4ti/cLCMUudTf//Mzkb7xNPXIc=`
164
164
 
165
165
  <!--
166
166
  Run `node --input-type=module -e "import {cspHashes} from '@vitejs/plugin-legacy'; console.log(cspHashes.map(h => 'sha256-'+h))"` to retrieve the value.
package/dist/index.cjs CHANGED
@@ -142,7 +142,7 @@ function toAssetPathFromHtml(filename, htmlPath, config) {
142
142
  );
143
143
  }
144
144
  const legacyEnvVarMarker = `__VITE_IS_LEGACY__`;
145
- const _require = node_module.createRequire((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href)));
145
+ const _require = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href)));
146
146
  function viteLegacyPlugin(options = {}) {
147
147
  let config;
148
148
  let targets;
@@ -181,7 +181,7 @@ function viteLegacyPlugin(options = {}) {
181
181
  const legacyConfigPlugin = {
182
182
  name: "vite:legacy-config",
183
183
  config(config2, env) {
184
- if (env.command === "build") {
184
+ if (env.command === "build" && !config2.build?.ssr) {
185
185
  if (!config2.build) {
186
186
  config2.build = {};
187
187
  }
@@ -561,7 +561,7 @@ async function buildPolyfillChunk(mode, imports, bundle, facadeToChunkMap, build
561
561
  const res = await vite.build({
562
562
  mode,
563
563
  // so that everything is resolved from here
564
- root: path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href)))),
564
+ root: path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href)))),
565
565
  configFile: false,
566
566
  logLevel: "error",
567
567
  plugins: [polyfillsPlugin(imports, excludeSystemJS)],
package/dist/index.mjs CHANGED
@@ -177,7 +177,7 @@ function viteLegacyPlugin(options = {}) {
177
177
  const legacyConfigPlugin = {
178
178
  name: "vite:legacy-config",
179
179
  config(config2, env) {
180
- if (env.command === "build") {
180
+ if (env.command === "build" && !config2.build?.ssr) {
181
181
  if (!config2.build) {
182
182
  config2.build = {};
183
183
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitejs/plugin-legacy",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "license": "MIT",
5
5
  "author": "Evan You",
6
6
  "files": [
@@ -41,13 +41,13 @@
41
41
  },
42
42
  "homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-legacy#readme",
43
43
  "dependencies": {
44
- "@babel/core": "^7.20.12",
44
+ "@babel/core": "^7.21.0",
45
45
  "@babel/preset-env": "^7.20.2",
46
- "browserslist": "^4.21.4",
47
- "core-js": "^3.27.2",
48
- "magic-string": "^0.27.0",
46
+ "browserslist": "^4.21.5",
47
+ "core-js": "^3.29.0",
48
+ "magic-string": "^0.30.0",
49
49
  "regenerator-runtime": "^0.13.11",
50
- "systemjs": "^6.13.0"
50
+ "systemjs": "^6.14.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "terser": "^5.4.0",