feat: use oxc for lowering #488
Annotations
3 errors and 1 warning
Test unit:
packages/vite/src/node/__tests__/plugins/modulePreloadPolyfill/modulePreloadPolyfill.spec.ts#L43
Error: Snapshot `load > loads modulepreload polyfill 1` mismatched
- Expected
+ Received
- "(function polyfill() {
+ "true && function polyfill() {
- const relList = document.createElement("link").relList;
+ const relList = document.createElement("link").relList;
- if (relList && relList.supports && relList.supports("modulepreload")) return;
+ if (relList && relList.supports && relList.supports("modulepreload")) return;
- for (const link of document.querySelectorAll('link[rel="modulepreload"]')) processPreload(link);
+ for (const link of document.querySelectorAll("link[rel=\"modulepreload\"]")) processPreload(link);
- new MutationObserver((mutations) => {
+ new MutationObserver((mutations) => {
- for (const mutation of mutations) {
+ for (const mutation of mutations) {
- if (mutation.type !== "childList") continue;
+ if (mutation.type !== "childList") continue;
- for (const node of mutation.addedNodes) if (node.tagName === "LINK" && node.rel === "modulepreload") processPreload(node);
+ for (const node of mutation.addedNodes) if (node.tagName === "LINK" && node.rel === "modulepreload") processPreload(node);
- }
- }).observe(document, {
+ }
+ }).observe(document, {
- childList: true,
+ childList: true,
- subtree: true
+ subtree: true
- });
+ });
- function getFetchOpts(link) {
+ function getFetchOpts(link) {
- const fetchOpts = {};
+ const fetchOpts = {};
- if (link.integrity) fetchOpts.integrity = link.integrity;
+ if (link.integrity) fetchOpts.integrity = link.integrity;
- if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy;
+ if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy;
- if (link.crossOrigin === "use-credentials") fetchOpts.credentials = "include";
+ if (link.crossOrigin === "use-credentials") fetchOpts.credentials = "include";
- else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit";
+ else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit";
- else fetchOpts.credentials = "same-origin";
+ else fetchOpts.credentials = "same-origin";
- return fetchOpts;
+ return fetchOpts;
- }
- function processPreload(link) {
+ }
+ function processPreload(link) {
- if (link.ep) return;
+ if (link.ep) return;
- link.ep = true;
+ link.ep = true;
- const fetchOpts = getFetchOpts(link);
+ const fetchOpts = getFetchOpts(link);
- fetch(link.href, fetchOpts);
+ fetch(link.href, fetchOpts);
- }
+ }
- })();
+ }();
"
❯ packages/vite/src/node/__tests__/plugins/modulePreloadPolyfill/modulePreloadPolyfill.spec.ts:43:28
|
Test unit:
packages/vite/src/node/__tests__/plugins/modulePreloadPolyfill/modulePreloadPolyfill.spec.ts#L51
Error: Snapshot `load > doesn't load modulepreload polyfill when format is cjs 1` mismatched
- Expected
+ Received
""use strict";
+ false && function polyfill() {
+ const relList = document.createElement("link").relList;
+ if (relList && relList.supports && relList.supports("modulepreload")) return;
+ for (const link of document.querySelectorAll("link[rel=\"modulepreload\"]")) processPreload(link);
+ new MutationObserver((mutations) => {
+ for (const mutation of mutations) {
+ if (mutation.type !== "childList") continue;
+ for (const node of mutation.addedNodes) if (node.tagName === "LINK" && node.rel === "modulepreload") processPreload(node);
+ }
+ }).observe(document, {
+ childList: true,
+ subtree: true
+ });
+ function getFetchOpts(link) {
+ const fetchOpts = {};
+ if (link.integrity) fetchOpts.integrity = link.integrity;
+ if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy;
+ if (link.crossOrigin === "use-credentials") fetchOpts.credentials = "include";
+ else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit";
+ else fetchOpts.credentials = "same-origin";
+ return fetchOpts;
+ }
+ function processPreload(link) {
+ if (link.ep) return;
+ link.ep = true;
+ const fetchOpts = getFetchOpts(link);
+ fetch(link.href, fetchOpts);
+ }
+ }();
"
❯ packages/vite/src/node/__tests__/plugins/modulePreloadPolyfill/modulePreloadPolyfill.spec.ts:51:28
|
Test unit
Process completed with exit code 1.
|
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Loading