UEA-PRODEM
This commit is contained in:
+11
-11
@@ -1,9 +1,9 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { exactRegex, makeIdFiltersToMatchWithQuery } from "@rolldown/pluginutils";
|
||||
import * as vite from "vite";
|
||||
import { createFilter } from "vite";
|
||||
import { exactRegex, makeIdFiltersToMatchWithQuery } from "@rolldown/pluginutils";
|
||||
|
||||
//#region ../common/refresh-utils.ts
|
||||
const runtimePublicPath = "/@react-refresh";
|
||||
@@ -184,14 +184,14 @@ function viteReact(opts = {}) {
|
||||
return newBabelOptions;
|
||||
})();
|
||||
const plugins = [...babelOptions.plugins];
|
||||
let reactCompilerPlugin$1 = getReactCompilerPlugin(plugins);
|
||||
if (reactCompilerPlugin$1 && ssr) {
|
||||
plugins.splice(plugins.indexOf(reactCompilerPlugin$1), 1);
|
||||
reactCompilerPlugin$1 = void 0;
|
||||
let reactCompilerPlugin = getReactCompilerPlugin(plugins);
|
||||
if (reactCompilerPlugin && ssr) {
|
||||
plugins.splice(plugins.indexOf(reactCompilerPlugin), 1);
|
||||
reactCompilerPlugin = void 0;
|
||||
}
|
||||
if (Array.isArray(reactCompilerPlugin$1) && reactCompilerPlugin$1[1]?.compilationMode === "annotation" && !compilerAnnotationRE.test(code)) {
|
||||
plugins.splice(plugins.indexOf(reactCompilerPlugin$1), 1);
|
||||
reactCompilerPlugin$1 = void 0;
|
||||
if (Array.isArray(reactCompilerPlugin) && reactCompilerPlugin[1]?.compilationMode === "annotation" && !compilerAnnotationRE.test(code)) {
|
||||
plugins.splice(plugins.indexOf(reactCompilerPlugin), 1);
|
||||
reactCompilerPlugin = void 0;
|
||||
}
|
||||
const isJSX = filepath.endsWith("x");
|
||||
const useFastRefresh = !(isRolldownVite || skipFastRefresh) && !ssr && (isJSX || (opts.jsxRuntime === "classic" ? importReactRE.test(code) : code.includes(jsxImportDevRuntime) || code.includes(jsxImportRuntime)));
|
||||
@@ -208,7 +208,7 @@ function viteReact(opts = {}) {
|
||||
root: projectRoot,
|
||||
filename: id,
|
||||
sourceFileName: filepath,
|
||||
retainLines: reactCompilerPlugin$1 ? false : !isProduction && isJSX && opts.jsxRuntime !== "classic",
|
||||
retainLines: reactCompilerPlugin ? false : !isProduction && isJSX && opts.jsxRuntime !== "classic",
|
||||
parserOpts: {
|
||||
...babelOptions.parserOpts,
|
||||
sourceType: "module",
|
||||
@@ -356,7 +356,7 @@ function viteReactForCjs(options) {
|
||||
}
|
||||
Object.assign(viteReactForCjs, { default: viteReactForCjs });
|
||||
function canSkipBabel(plugins, babelOptions) {
|
||||
return !(plugins.length || babelOptions.presets.length || babelOptions.configFile || babelOptions.babelrc);
|
||||
return !(plugins.length || babelOptions.presets.length || babelOptions.overrides.length || babelOptions.configFile || babelOptions.babelrc);
|
||||
}
|
||||
const loadedPlugin = /* @__PURE__ */ new Map();
|
||||
function loadPlugin(path) {
|
||||
|
||||
Reference in New Issue
Block a user