first commit
This commit is contained in:
21
node_modules/@vitejs/plugin-react/LICENSE
generated
vendored
Normal file
21
node_modules/@vitejs/plugin-react/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
125
node_modules/@vitejs/plugin-react/README.md
generated
vendored
Normal file
125
node_modules/@vitejs/plugin-react/README.md
generated
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
# @vitejs/plugin-react [](https://npmjs.com/package/@vitejs/plugin-react)
|
||||
|
||||
The all-in-one Vite plugin for React projects.
|
||||
|
||||
- enable [Fast Refresh](https://www.npmjs.com/package/react-refresh) in development
|
||||
- use the [automatic JSX runtime](https://github.com/alloc/vite-react-jsx#faq)
|
||||
- avoid manual `import React` in `.jsx` and `.tsx` modules
|
||||
- dedupe the `react` and `react-dom` packages
|
||||
- use custom Babel plugins/presets
|
||||
|
||||
```js
|
||||
// vite.config.js
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
})
|
||||
```
|
||||
|
||||
## Filter which files use Fast Refresh
|
||||
|
||||
By default, Fast Refresh is used by files ending with `.js`, `.jsx`, `.ts`, and `.tsx`, except for files with a `node_modules` parent directory.
|
||||
|
||||
In some situations, you may not want a file to act as a HMR boundary, instead preferring that the changes propagate higher in the stack before being handled. In these cases, you can provide an `include` and/or `exclude` option, which can be a regex, a [picomatch](https://github.com/micromatch/picomatch#globbing-features) pattern, or an array of either. Files matching `include` and not `exclude` will use Fast Refresh. The defaults are always applied.
|
||||
|
||||
```js
|
||||
react({
|
||||
// Exclude storybook stories
|
||||
exclude: /\.stories\.(t|j)sx?$/,
|
||||
// Only .tsx files
|
||||
include: '**/*.tsx',
|
||||
})
|
||||
```
|
||||
|
||||
### Configure the JSX import source
|
||||
|
||||
Control where the JSX factory is imported from. This option is ignored for classic `jsxRuntime`.
|
||||
|
||||
```js
|
||||
react({
|
||||
jsxImportSource: '@emotion/react',
|
||||
})
|
||||
```
|
||||
|
||||
## Opting out of the automatic JSX runtime
|
||||
|
||||
By default, the plugin uses the [automatic JSX runtime](https://github.com/alloc/vite-react-jsx#faq). However, if you encounter any issues, you may opt out using the `jsxRuntime` option.
|
||||
|
||||
```js
|
||||
react({
|
||||
jsxRuntime: 'classic',
|
||||
})
|
||||
```
|
||||
|
||||
## Babel configuration
|
||||
|
||||
The `babel` option lets you add plugins, presets, and [other configuration](https://babeljs.io/docs/en/options) to the Babel transformation performed on each JSX/TSX file.
|
||||
|
||||
```js
|
||||
react({
|
||||
babel: {
|
||||
presets: [...],
|
||||
// Your plugins run before any built-in transform (eg: Fast Refresh)
|
||||
plugins: [...],
|
||||
// Use .babelrc files
|
||||
babelrc: true,
|
||||
// Use babel.config.js files
|
||||
configFile: true,
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
### Proposed syntax
|
||||
|
||||
If you are using ES syntax that are still in proposal status (e.g. class properties), you can selectively enable them with the `babel.parserOpts.plugins` option:
|
||||
|
||||
```js
|
||||
react({
|
||||
babel: {
|
||||
parserOpts: {
|
||||
plugins: ['decorators-legacy'],
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
This option does not enable _code transformation_. That is handled by esbuild.
|
||||
|
||||
**Note:** TypeScript syntax is handled automatically.
|
||||
|
||||
Here's the [complete list of Babel parser plugins](https://babeljs.io/docs/en/babel-parser#ecmascript-proposalshttpsgithubcombabelproposals).
|
||||
|
||||
## Middleware mode
|
||||
|
||||
In [middleware mode](https://vitejs.dev/config/server-options.html#server-middlewaremode), you should make sure your entry `index.html` file is transformed by Vite. Here's an example for an Express server:
|
||||
|
||||
```js
|
||||
app.get('/', async (req, res, next) => {
|
||||
try {
|
||||
let html = fs.readFileSync(path.resolve(root, 'index.html'), 'utf-8')
|
||||
|
||||
// Transform HTML using Vite plugins.
|
||||
html = await viteServer.transformIndexHtml(req.url, html)
|
||||
|
||||
res.send(html)
|
||||
} catch (e) {
|
||||
return next(e)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
Otherwise, you'll probably get this error:
|
||||
|
||||
```
|
||||
Uncaught Error: @vitejs/plugin-react can't detect preamble. Something is wrong.
|
||||
```
|
||||
|
||||
## Consistent components exports
|
||||
|
||||
For React refresh to work correctly, your file should only export React components. You can find a good explanation in the [Gatsby docs](https://www.gatsbyjs.com/docs/reference/local-development/fast-refresh/#how-it-works).
|
||||
|
||||
If an incompatible change in exports is found, the module will be invalidated and HMR will propagate. To make it easier to export simple constants alongside your component, the module is only invalidated when their value changes.
|
||||
|
||||
You can catch mistakes and get more detailed warning with this [eslint rule](https://github.com/ArnaudBarre/eslint-plugin-react-refresh).
|
||||
373
node_modules/@vitejs/plugin-react/dist/index.cjs
generated
vendored
Normal file
373
node_modules/@vitejs/plugin-react/dist/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,373 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('node:path');
|
||||
const babel = require('@babel/core');
|
||||
const vite = require('vite');
|
||||
const MagicString = require('magic-string');
|
||||
const fs = require('node:fs');
|
||||
const node_module = require('node:module');
|
||||
|
||||
function _interopNamespaceDefault(e) {
|
||||
const n = Object.create(null);
|
||||
if (e) {
|
||||
for (const k in e) {
|
||||
n[k] = e[k];
|
||||
}
|
||||
}
|
||||
n.default = e;
|
||||
return n;
|
||||
}
|
||||
|
||||
const babel__namespace = /*#__PURE__*/_interopNamespaceDefault(babel);
|
||||
|
||||
const runtimePublicPath = "/@react-refresh";
|
||||
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)));
|
||||
const reactRefreshDir = path.dirname(
|
||||
_require.resolve("react-refresh/package.json")
|
||||
);
|
||||
const runtimeFilePath = path.join(
|
||||
reactRefreshDir,
|
||||
"cjs/react-refresh-runtime.development.js"
|
||||
);
|
||||
const runtimeCode = `
|
||||
const exports = {}
|
||||
${fs.readFileSync(runtimeFilePath, "utf-8")}
|
||||
${fs.readFileSync(_require.resolve("./refreshUtils.js"), "utf-8")}
|
||||
export default exports
|
||||
`;
|
||||
const preambleCode = `
|
||||
import RefreshRuntime from "__BASE__${runtimePublicPath.slice(1)}"
|
||||
RefreshRuntime.injectIntoGlobalHook(window)
|
||||
window.$RefreshReg$ = () => {}
|
||||
window.$RefreshSig$ = () => (type) => type
|
||||
window.__vite_plugin_react_preamble_installed__ = true
|
||||
`;
|
||||
const header = `
|
||||
import RefreshRuntime from "${runtimePublicPath}";
|
||||
|
||||
let prevRefreshReg;
|
||||
let prevRefreshSig;
|
||||
|
||||
if (import.meta.hot) {
|
||||
if (!window.__vite_plugin_react_preamble_installed__) {
|
||||
throw new Error(
|
||||
"@vitejs/plugin-react can't detect preamble. Something is wrong. " +
|
||||
"See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201"
|
||||
);
|
||||
}
|
||||
|
||||
prevRefreshReg = window.$RefreshReg$;
|
||||
prevRefreshSig = window.$RefreshSig$;
|
||||
window.$RefreshReg$ = (type, id) => {
|
||||
RefreshRuntime.register(type, __SOURCE__ + " " + id)
|
||||
};
|
||||
window.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform;
|
||||
}`.replace(/\n+/g, "");
|
||||
const footer = `
|
||||
if (import.meta.hot) {
|
||||
window.$RefreshReg$ = prevRefreshReg;
|
||||
window.$RefreshSig$ = prevRefreshSig;
|
||||
|
||||
import(/* @vite-ignore */ import.meta.url).then((currentExports) => {
|
||||
RefreshRuntime.registerExportsForReactRefresh(__SOURCE__, currentExports);
|
||||
import.meta.hot.accept((nextExports) => {
|
||||
if (!nextExports) return;
|
||||
const invalidateMessage = RefreshRuntime.validateRefreshBoundaryAndEnqueueUpdate(currentExports, nextExports);
|
||||
if (invalidateMessage) import.meta.hot.invalidate(invalidateMessage);
|
||||
});
|
||||
});
|
||||
}`;
|
||||
function addRefreshWrapper(code, id) {
|
||||
return header.replace("__SOURCE__", JSON.stringify(id)) + code + footer.replace("__SOURCE__", JSON.stringify(id));
|
||||
}
|
||||
|
||||
const prependReactImportCode = "import React from 'react'; ";
|
||||
const refreshContentRE = /\$Refresh(?:Reg|Sig)\$\(/;
|
||||
function viteReact(opts = {}) {
|
||||
let devBase = "/";
|
||||
let filter = vite.createFilter(opts.include, opts.exclude);
|
||||
let needHiresSourcemap = false;
|
||||
let isProduction = true;
|
||||
let projectRoot = process.cwd();
|
||||
let skipFastRefresh = opts.fastRefresh === false;
|
||||
let skipReactImport = false;
|
||||
let runPluginOverrides = (options, context) => false;
|
||||
let staticBabelOptions;
|
||||
const useAutomaticRuntime = opts.jsxRuntime !== "classic";
|
||||
const importReactRE = /(?:^|\n)import\s+(?:\*\s+as\s+)?React(?:,|\s+)/;
|
||||
const fileExtensionRE = /\.[^/\s?]+$/;
|
||||
const viteBabel = {
|
||||
name: "vite:react-babel",
|
||||
enforce: "pre",
|
||||
config(userConfig, { mode }) {
|
||||
const resolvedRoot = vite.normalizePath(
|
||||
userConfig.root ? path.resolve(userConfig.root) : process.cwd()
|
||||
);
|
||||
const envDir = userConfig.envDir ? vite.normalizePath(path.resolve(resolvedRoot, userConfig.envDir)) : resolvedRoot;
|
||||
vite.loadEnv(mode, envDir, vite.resolveEnvPrefix(userConfig));
|
||||
const isProduction2 = (process.env.NODE_ENV || process.env.VITE_USER_NODE_ENV || mode) === "production";
|
||||
if (opts.jsxRuntime === "classic") {
|
||||
return {
|
||||
esbuild: {
|
||||
logOverride: {
|
||||
"this-is-undefined-in-esm": "silent"
|
||||
},
|
||||
jsx: "transform",
|
||||
jsxImportSource: opts.jsxImportSource,
|
||||
jsxSideEffects: opts.jsxPure === false
|
||||
}
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
esbuild: {
|
||||
jsxDev: !isProduction2,
|
||||
jsx: "automatic",
|
||||
jsxImportSource: opts.jsxImportSource,
|
||||
jsxSideEffects: opts.jsxPure === false
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
configResolved(config) {
|
||||
devBase = config.base;
|
||||
projectRoot = config.root;
|
||||
filter = vite.createFilter(opts.include, opts.exclude, {
|
||||
resolve: projectRoot
|
||||
});
|
||||
needHiresSourcemap = config.command === "build" && !!config.build.sourcemap;
|
||||
isProduction = config.isProduction;
|
||||
skipFastRefresh || (skipFastRefresh = isProduction || config.command === "build");
|
||||
const jsxInject = config.esbuild && config.esbuild.jsxInject;
|
||||
if (jsxInject && importReactRE.test(jsxInject)) {
|
||||
skipReactImport = true;
|
||||
config.logger.warn(
|
||||
"[@vitejs/plugin-react] This plugin imports React for you automatically, so you can stop using `esbuild.jsxInject` for that purpose."
|
||||
);
|
||||
}
|
||||
config.plugins.forEach((plugin) => {
|
||||
const hasConflict = plugin.name === "react-refresh" || plugin !== viteReactJsx && plugin.name === "vite:react-jsx";
|
||||
if (hasConflict)
|
||||
return config.logger.warn(
|
||||
`[@vitejs/plugin-react] You should stop using "${plugin.name}" since this plugin conflicts with it.`
|
||||
);
|
||||
});
|
||||
runPluginOverrides = (babelOptions, context) => {
|
||||
const hooks = config.plugins.map((plugin) => plugin.api?.reactBabel).filter(Boolean);
|
||||
if (hooks.length > 0) {
|
||||
return (runPluginOverrides = (babelOptions2, context2) => {
|
||||
hooks.forEach((hook) => hook(babelOptions2, context2, config));
|
||||
return true;
|
||||
})(babelOptions, context);
|
||||
}
|
||||
runPluginOverrides = () => false;
|
||||
return false;
|
||||
};
|
||||
},
|
||||
async transform(code, id, options) {
|
||||
const ssr = options?.ssr === true;
|
||||
const [filepath, querystring = ""] = id.split("?");
|
||||
const [extension = ""] = querystring.match(fileExtensionRE) || filepath.match(fileExtensionRE) || [];
|
||||
if (/\.(?:mjs|[tj]sx?)$/.test(extension)) {
|
||||
const isJSX = extension.endsWith("x");
|
||||
const isNodeModules = id.includes("/node_modules/");
|
||||
const isProjectFile = !isNodeModules && (id[0] === "\0" || id.startsWith(projectRoot + "/"));
|
||||
let babelOptions = staticBabelOptions;
|
||||
if (typeof opts.babel === "function") {
|
||||
const rawOptions = opts.babel(id, { ssr });
|
||||
babelOptions = createBabelOptions(rawOptions);
|
||||
runPluginOverrides(babelOptions, { ssr, id });
|
||||
} else if (!babelOptions) {
|
||||
babelOptions = createBabelOptions(opts.babel);
|
||||
if (!runPluginOverrides(babelOptions, { ssr, id })) {
|
||||
staticBabelOptions = babelOptions;
|
||||
}
|
||||
}
|
||||
const plugins = isProjectFile ? [...babelOptions.plugins] : [];
|
||||
let useFastRefresh = false;
|
||||
if (!skipFastRefresh && !ssr && !isNodeModules) {
|
||||
const isReactModule = isJSX || importReactRE.test(code);
|
||||
if (isReactModule && filter(id)) {
|
||||
useFastRefresh = true;
|
||||
plugins.push([
|
||||
await loadPlugin("react-refresh/babel"),
|
||||
{ skipEnvCheck: true }
|
||||
]);
|
||||
}
|
||||
}
|
||||
let prependReactImport = false;
|
||||
if (!isProjectFile || isJSX) {
|
||||
if (!useAutomaticRuntime && isProjectFile) {
|
||||
if (!isProduction) {
|
||||
plugins.push(
|
||||
await loadPlugin("@babel/plugin-transform-react-jsx-self"),
|
||||
await loadPlugin("@babel/plugin-transform-react-jsx-source")
|
||||
);
|
||||
}
|
||||
if (!skipReactImport && !importReactRE.test(code)) {
|
||||
prependReactImport = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
let inputMap;
|
||||
if (prependReactImport) {
|
||||
if (needHiresSourcemap) {
|
||||
const s = new MagicString(code);
|
||||
s.prepend(prependReactImportCode);
|
||||
code = s.toString();
|
||||
inputMap = s.generateMap({ hires: true, source: id });
|
||||
} else {
|
||||
code = prependReactImportCode + code;
|
||||
}
|
||||
}
|
||||
const shouldSkip = !plugins.length && !babelOptions.configFile && !(isProjectFile && babelOptions.babelrc);
|
||||
if (shouldSkip) {
|
||||
return {
|
||||
code,
|
||||
map: inputMap ?? null
|
||||
};
|
||||
}
|
||||
const parserPlugins = [
|
||||
...babelOptions.parserOpts.plugins,
|
||||
"importMeta",
|
||||
// This plugin is applied before esbuild transforms the code,
|
||||
// so we need to enable some stage 3 syntax that is supported in
|
||||
// TypeScript and some environments already.
|
||||
"topLevelAwait",
|
||||
"classProperties",
|
||||
"classPrivateProperties",
|
||||
"classPrivateMethods"
|
||||
];
|
||||
if (!extension.endsWith(".ts")) {
|
||||
parserPlugins.push("jsx");
|
||||
}
|
||||
if (/\.tsx?$/.test(extension)) {
|
||||
parserPlugins.push("typescript");
|
||||
}
|
||||
const result = await babel__namespace.transformAsync(code, {
|
||||
...babelOptions,
|
||||
root: projectRoot,
|
||||
filename: id,
|
||||
sourceFileName: filepath,
|
||||
parserOpts: {
|
||||
...babelOptions.parserOpts,
|
||||
sourceType: "module",
|
||||
allowAwaitOutsideFunction: true,
|
||||
plugins: parserPlugins
|
||||
},
|
||||
generatorOpts: {
|
||||
...babelOptions.generatorOpts,
|
||||
decoratorsBeforeExport: true
|
||||
},
|
||||
plugins,
|
||||
sourceMaps: true,
|
||||
// Vite handles sourcemap flattening
|
||||
inputSourceMap: inputMap ?? false
|
||||
});
|
||||
if (result) {
|
||||
let code2 = result.code;
|
||||
if (useFastRefresh && refreshContentRE.test(code2)) {
|
||||
code2 = addRefreshWrapper(code2, id);
|
||||
}
|
||||
return {
|
||||
code: code2,
|
||||
map: result.map
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const viteReactRefresh = {
|
||||
name: "vite:react-refresh",
|
||||
enforce: "pre",
|
||||
config: () => ({
|
||||
resolve: {
|
||||
dedupe: ["react", "react-dom"]
|
||||
}
|
||||
}),
|
||||
resolveId(id) {
|
||||
if (id === runtimePublicPath) {
|
||||
return id;
|
||||
}
|
||||
},
|
||||
load(id) {
|
||||
if (id === runtimePublicPath) {
|
||||
return runtimeCode;
|
||||
}
|
||||
},
|
||||
transformIndexHtml() {
|
||||
if (!skipFastRefresh)
|
||||
return [
|
||||
{
|
||||
tag: "script",
|
||||
attrs: { type: "module" },
|
||||
children: preambleCode.replace(`__BASE__`, devBase)
|
||||
}
|
||||
];
|
||||
}
|
||||
};
|
||||
const reactJsxRuntimeId = "react/jsx-runtime";
|
||||
const reactJsxDevRuntimeId = "react/jsx-dev-runtime";
|
||||
const virtualReactJsxRuntimeId = "\0" + reactJsxRuntimeId;
|
||||
const virtualReactJsxDevRuntimeId = "\0" + reactJsxDevRuntimeId;
|
||||
const viteReactJsx = {
|
||||
name: "vite:react-jsx",
|
||||
enforce: "pre",
|
||||
config() {
|
||||
return {
|
||||
optimizeDeps: {
|
||||
// We can't add `react-dom` because the dependency is `react-dom/client`
|
||||
// for React 18 while it's `react-dom` for React 17. We'd need to detect
|
||||
// what React version the user has installed.
|
||||
include: [reactJsxRuntimeId, reactJsxDevRuntimeId, "react"]
|
||||
}
|
||||
};
|
||||
},
|
||||
resolveId(id, importer) {
|
||||
if (id === reactJsxRuntimeId && importer !== virtualReactJsxRuntimeId) {
|
||||
return virtualReactJsxRuntimeId;
|
||||
}
|
||||
if (id === reactJsxDevRuntimeId && importer !== virtualReactJsxDevRuntimeId) {
|
||||
return virtualReactJsxDevRuntimeId;
|
||||
}
|
||||
},
|
||||
load(id) {
|
||||
if (id === virtualReactJsxRuntimeId) {
|
||||
return [
|
||||
`import * as jsxRuntime from ${JSON.stringify(reactJsxRuntimeId)}`,
|
||||
`export const Fragment = jsxRuntime.Fragment`,
|
||||
`export const jsx = jsxRuntime.jsx`,
|
||||
`export const jsxs = jsxRuntime.jsxs`
|
||||
].join("\n");
|
||||
}
|
||||
if (id === virtualReactJsxDevRuntimeId) {
|
||||
return [
|
||||
`import * as jsxRuntime from ${JSON.stringify(reactJsxDevRuntimeId)}`,
|
||||
`export const Fragment = jsxRuntime.Fragment`,
|
||||
`export const jsxDEV = jsxRuntime.jsxDEV`
|
||||
].join("\n");
|
||||
}
|
||||
}
|
||||
};
|
||||
return [viteBabel, viteReactRefresh, useAutomaticRuntime && viteReactJsx];
|
||||
}
|
||||
viteReact.preambleCode = preambleCode;
|
||||
function loadPlugin(path2) {
|
||||
return import(path2).then((module) => module.default || module);
|
||||
}
|
||||
function createBabelOptions(rawOptions) {
|
||||
var _a;
|
||||
const babelOptions = {
|
||||
babelrc: false,
|
||||
configFile: false,
|
||||
...rawOptions
|
||||
};
|
||||
babelOptions.plugins || (babelOptions.plugins = []);
|
||||
babelOptions.presets || (babelOptions.presets = []);
|
||||
babelOptions.overrides || (babelOptions.overrides = []);
|
||||
babelOptions.parserOpts || (babelOptions.parserOpts = {});
|
||||
(_a = babelOptions.parserOpts).plugins || (_a.plugins = []);
|
||||
return babelOptions;
|
||||
}
|
||||
|
||||
module.exports = viteReact;
|
||||
module.exports.default = viteReact;
|
||||
69
node_modules/@vitejs/plugin-react/dist/index.d.ts
generated
vendored
Normal file
69
node_modules/@vitejs/plugin-react/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
import { TransformOptions, ParserOptions } from '@babel/core';
|
||||
import { ResolvedConfig, PluginOption } from 'vite';
|
||||
|
||||
interface Options {
|
||||
include?: string | RegExp | Array<string | RegExp>;
|
||||
exclude?: string | RegExp | Array<string | RegExp>;
|
||||
/**
|
||||
* Enable `react-refresh` integration. Vite disables this in prod env or build mode.
|
||||
* @default true
|
||||
*/
|
||||
fastRefresh?: boolean;
|
||||
/**
|
||||
* Set this to `"automatic"` to use [vite-react-jsx](https://github.com/alloc/vite-react-jsx).
|
||||
* @default "automatic"
|
||||
*/
|
||||
jsxRuntime?: 'classic' | 'automatic';
|
||||
/**
|
||||
* Control where the JSX factory is imported from.
|
||||
* This option is ignored when `jsxRuntime` is not `"automatic"`.
|
||||
* @default "react"
|
||||
*/
|
||||
jsxImportSource?: string;
|
||||
/**
|
||||
* Set this to `true` to annotate the JSX factory with `\/* @__PURE__ *\/`.
|
||||
* This option is ignored when `jsxRuntime` is not `"automatic"`.
|
||||
* @default true
|
||||
*/
|
||||
jsxPure?: boolean;
|
||||
/**
|
||||
* Babel configuration applied in both dev and prod.
|
||||
*/
|
||||
babel?: BabelOptions | ((id: string, options: {
|
||||
ssr?: boolean;
|
||||
}) => BabelOptions);
|
||||
}
|
||||
type BabelOptions = Omit<TransformOptions, 'ast' | 'filename' | 'root' | 'sourceFileName' | 'sourceMaps' | 'inputSourceMap'>;
|
||||
/**
|
||||
* The object type used by the `options` passed to plugins with
|
||||
* an `api.reactBabel` method.
|
||||
*/
|
||||
interface ReactBabelOptions extends BabelOptions {
|
||||
plugins: Extract<BabelOptions['plugins'], any[]>;
|
||||
presets: Extract<BabelOptions['presets'], any[]>;
|
||||
overrides: Extract<BabelOptions['overrides'], any[]>;
|
||||
parserOpts: ParserOptions & {
|
||||
plugins: Extract<ParserOptions['plugins'], any[]>;
|
||||
};
|
||||
}
|
||||
type ReactBabelHook = (babelConfig: ReactBabelOptions, context: ReactBabelHookContext, config: ResolvedConfig) => void;
|
||||
type ReactBabelHookContext = {
|
||||
ssr: boolean;
|
||||
id: string;
|
||||
};
|
||||
declare module 'vite' {
|
||||
interface Plugin {
|
||||
api?: {
|
||||
/**
|
||||
* Manipulate the Babel options of `@vitejs/plugin-react`
|
||||
*/
|
||||
reactBabel?: ReactBabelHook;
|
||||
};
|
||||
}
|
||||
}
|
||||
declare function viteReact(opts?: Options): PluginOption[];
|
||||
declare namespace viteReact {
|
||||
var preambleCode: string;
|
||||
}
|
||||
|
||||
export { BabelOptions, Options, ReactBabelOptions, viteReact as default };
|
||||
357
node_modules/@vitejs/plugin-react/dist/index.mjs
generated
vendored
Normal file
357
node_modules/@vitejs/plugin-react/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,357 @@
|
||||
import path from 'node:path';
|
||||
import * as babel from '@babel/core';
|
||||
import { createFilter, normalizePath, loadEnv, resolveEnvPrefix } from 'vite';
|
||||
import MagicString from 'magic-string';
|
||||
import fs from 'node:fs';
|
||||
import { createRequire } from 'node:module';
|
||||
|
||||
const runtimePublicPath = "/@react-refresh";
|
||||
const _require = createRequire(import.meta.url);
|
||||
const reactRefreshDir = path.dirname(
|
||||
_require.resolve("react-refresh/package.json")
|
||||
);
|
||||
const runtimeFilePath = path.join(
|
||||
reactRefreshDir,
|
||||
"cjs/react-refresh-runtime.development.js"
|
||||
);
|
||||
const runtimeCode = `
|
||||
const exports = {}
|
||||
${fs.readFileSync(runtimeFilePath, "utf-8")}
|
||||
${fs.readFileSync(_require.resolve("./refreshUtils.js"), "utf-8")}
|
||||
export default exports
|
||||
`;
|
||||
const preambleCode = `
|
||||
import RefreshRuntime from "__BASE__${runtimePublicPath.slice(1)}"
|
||||
RefreshRuntime.injectIntoGlobalHook(window)
|
||||
window.$RefreshReg$ = () => {}
|
||||
window.$RefreshSig$ = () => (type) => type
|
||||
window.__vite_plugin_react_preamble_installed__ = true
|
||||
`;
|
||||
const header = `
|
||||
import RefreshRuntime from "${runtimePublicPath}";
|
||||
|
||||
let prevRefreshReg;
|
||||
let prevRefreshSig;
|
||||
|
||||
if (import.meta.hot) {
|
||||
if (!window.__vite_plugin_react_preamble_installed__) {
|
||||
throw new Error(
|
||||
"@vitejs/plugin-react can't detect preamble. Something is wrong. " +
|
||||
"See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201"
|
||||
);
|
||||
}
|
||||
|
||||
prevRefreshReg = window.$RefreshReg$;
|
||||
prevRefreshSig = window.$RefreshSig$;
|
||||
window.$RefreshReg$ = (type, id) => {
|
||||
RefreshRuntime.register(type, __SOURCE__ + " " + id)
|
||||
};
|
||||
window.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform;
|
||||
}`.replace(/\n+/g, "");
|
||||
const footer = `
|
||||
if (import.meta.hot) {
|
||||
window.$RefreshReg$ = prevRefreshReg;
|
||||
window.$RefreshSig$ = prevRefreshSig;
|
||||
|
||||
import(/* @vite-ignore */ import.meta.url).then((currentExports) => {
|
||||
RefreshRuntime.registerExportsForReactRefresh(__SOURCE__, currentExports);
|
||||
import.meta.hot.accept((nextExports) => {
|
||||
if (!nextExports) return;
|
||||
const invalidateMessage = RefreshRuntime.validateRefreshBoundaryAndEnqueueUpdate(currentExports, nextExports);
|
||||
if (invalidateMessage) import.meta.hot.invalidate(invalidateMessage);
|
||||
});
|
||||
});
|
||||
}`;
|
||||
function addRefreshWrapper(code, id) {
|
||||
return header.replace("__SOURCE__", JSON.stringify(id)) + code + footer.replace("__SOURCE__", JSON.stringify(id));
|
||||
}
|
||||
|
||||
const prependReactImportCode = "import React from 'react'; ";
|
||||
const refreshContentRE = /\$Refresh(?:Reg|Sig)\$\(/;
|
||||
function viteReact(opts = {}) {
|
||||
let devBase = "/";
|
||||
let filter = createFilter(opts.include, opts.exclude);
|
||||
let needHiresSourcemap = false;
|
||||
let isProduction = true;
|
||||
let projectRoot = process.cwd();
|
||||
let skipFastRefresh = opts.fastRefresh === false;
|
||||
let skipReactImport = false;
|
||||
let runPluginOverrides = (options, context) => false;
|
||||
let staticBabelOptions;
|
||||
const useAutomaticRuntime = opts.jsxRuntime !== "classic";
|
||||
const importReactRE = /(?:^|\n)import\s+(?:\*\s+as\s+)?React(?:,|\s+)/;
|
||||
const fileExtensionRE = /\.[^/\s?]+$/;
|
||||
const viteBabel = {
|
||||
name: "vite:react-babel",
|
||||
enforce: "pre",
|
||||
config(userConfig, { mode }) {
|
||||
const resolvedRoot = normalizePath(
|
||||
userConfig.root ? path.resolve(userConfig.root) : process.cwd()
|
||||
);
|
||||
const envDir = userConfig.envDir ? normalizePath(path.resolve(resolvedRoot, userConfig.envDir)) : resolvedRoot;
|
||||
loadEnv(mode, envDir, resolveEnvPrefix(userConfig));
|
||||
const isProduction2 = (process.env.NODE_ENV || process.env.VITE_USER_NODE_ENV || mode) === "production";
|
||||
if (opts.jsxRuntime === "classic") {
|
||||
return {
|
||||
esbuild: {
|
||||
logOverride: {
|
||||
"this-is-undefined-in-esm": "silent"
|
||||
},
|
||||
jsx: "transform",
|
||||
jsxImportSource: opts.jsxImportSource,
|
||||
jsxSideEffects: opts.jsxPure === false
|
||||
}
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
esbuild: {
|
||||
jsxDev: !isProduction2,
|
||||
jsx: "automatic",
|
||||
jsxImportSource: opts.jsxImportSource,
|
||||
jsxSideEffects: opts.jsxPure === false
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
configResolved(config) {
|
||||
devBase = config.base;
|
||||
projectRoot = config.root;
|
||||
filter = createFilter(opts.include, opts.exclude, {
|
||||
resolve: projectRoot
|
||||
});
|
||||
needHiresSourcemap = config.command === "build" && !!config.build.sourcemap;
|
||||
isProduction = config.isProduction;
|
||||
skipFastRefresh || (skipFastRefresh = isProduction || config.command === "build");
|
||||
const jsxInject = config.esbuild && config.esbuild.jsxInject;
|
||||
if (jsxInject && importReactRE.test(jsxInject)) {
|
||||
skipReactImport = true;
|
||||
config.logger.warn(
|
||||
"[@vitejs/plugin-react] This plugin imports React for you automatically, so you can stop using `esbuild.jsxInject` for that purpose."
|
||||
);
|
||||
}
|
||||
config.plugins.forEach((plugin) => {
|
||||
const hasConflict = plugin.name === "react-refresh" || plugin !== viteReactJsx && plugin.name === "vite:react-jsx";
|
||||
if (hasConflict)
|
||||
return config.logger.warn(
|
||||
`[@vitejs/plugin-react] You should stop using "${plugin.name}" since this plugin conflicts with it.`
|
||||
);
|
||||
});
|
||||
runPluginOverrides = (babelOptions, context) => {
|
||||
const hooks = config.plugins.map((plugin) => plugin.api?.reactBabel).filter(Boolean);
|
||||
if (hooks.length > 0) {
|
||||
return (runPluginOverrides = (babelOptions2, context2) => {
|
||||
hooks.forEach((hook) => hook(babelOptions2, context2, config));
|
||||
return true;
|
||||
})(babelOptions, context);
|
||||
}
|
||||
runPluginOverrides = () => false;
|
||||
return false;
|
||||
};
|
||||
},
|
||||
async transform(code, id, options) {
|
||||
const ssr = options?.ssr === true;
|
||||
const [filepath, querystring = ""] = id.split("?");
|
||||
const [extension = ""] = querystring.match(fileExtensionRE) || filepath.match(fileExtensionRE) || [];
|
||||
if (/\.(?:mjs|[tj]sx?)$/.test(extension)) {
|
||||
const isJSX = extension.endsWith("x");
|
||||
const isNodeModules = id.includes("/node_modules/");
|
||||
const isProjectFile = !isNodeModules && (id[0] === "\0" || id.startsWith(projectRoot + "/"));
|
||||
let babelOptions = staticBabelOptions;
|
||||
if (typeof opts.babel === "function") {
|
||||
const rawOptions = opts.babel(id, { ssr });
|
||||
babelOptions = createBabelOptions(rawOptions);
|
||||
runPluginOverrides(babelOptions, { ssr, id });
|
||||
} else if (!babelOptions) {
|
||||
babelOptions = createBabelOptions(opts.babel);
|
||||
if (!runPluginOverrides(babelOptions, { ssr, id })) {
|
||||
staticBabelOptions = babelOptions;
|
||||
}
|
||||
}
|
||||
const plugins = isProjectFile ? [...babelOptions.plugins] : [];
|
||||
let useFastRefresh = false;
|
||||
if (!skipFastRefresh && !ssr && !isNodeModules) {
|
||||
const isReactModule = isJSX || importReactRE.test(code);
|
||||
if (isReactModule && filter(id)) {
|
||||
useFastRefresh = true;
|
||||
plugins.push([
|
||||
await loadPlugin("react-refresh/babel"),
|
||||
{ skipEnvCheck: true }
|
||||
]);
|
||||
}
|
||||
}
|
||||
let prependReactImport = false;
|
||||
if (!isProjectFile || isJSX) {
|
||||
if (!useAutomaticRuntime && isProjectFile) {
|
||||
if (!isProduction) {
|
||||
plugins.push(
|
||||
await loadPlugin("@babel/plugin-transform-react-jsx-self"),
|
||||
await loadPlugin("@babel/plugin-transform-react-jsx-source")
|
||||
);
|
||||
}
|
||||
if (!skipReactImport && !importReactRE.test(code)) {
|
||||
prependReactImport = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
let inputMap;
|
||||
if (prependReactImport) {
|
||||
if (needHiresSourcemap) {
|
||||
const s = new MagicString(code);
|
||||
s.prepend(prependReactImportCode);
|
||||
code = s.toString();
|
||||
inputMap = s.generateMap({ hires: true, source: id });
|
||||
} else {
|
||||
code = prependReactImportCode + code;
|
||||
}
|
||||
}
|
||||
const shouldSkip = !plugins.length && !babelOptions.configFile && !(isProjectFile && babelOptions.babelrc);
|
||||
if (shouldSkip) {
|
||||
return {
|
||||
code,
|
||||
map: inputMap ?? null
|
||||
};
|
||||
}
|
||||
const parserPlugins = [
|
||||
...babelOptions.parserOpts.plugins,
|
||||
"importMeta",
|
||||
// This plugin is applied before esbuild transforms the code,
|
||||
// so we need to enable some stage 3 syntax that is supported in
|
||||
// TypeScript and some environments already.
|
||||
"topLevelAwait",
|
||||
"classProperties",
|
||||
"classPrivateProperties",
|
||||
"classPrivateMethods"
|
||||
];
|
||||
if (!extension.endsWith(".ts")) {
|
||||
parserPlugins.push("jsx");
|
||||
}
|
||||
if (/\.tsx?$/.test(extension)) {
|
||||
parserPlugins.push("typescript");
|
||||
}
|
||||
const result = await babel.transformAsync(code, {
|
||||
...babelOptions,
|
||||
root: projectRoot,
|
||||
filename: id,
|
||||
sourceFileName: filepath,
|
||||
parserOpts: {
|
||||
...babelOptions.parserOpts,
|
||||
sourceType: "module",
|
||||
allowAwaitOutsideFunction: true,
|
||||
plugins: parserPlugins
|
||||
},
|
||||
generatorOpts: {
|
||||
...babelOptions.generatorOpts,
|
||||
decoratorsBeforeExport: true
|
||||
},
|
||||
plugins,
|
||||
sourceMaps: true,
|
||||
// Vite handles sourcemap flattening
|
||||
inputSourceMap: inputMap ?? false
|
||||
});
|
||||
if (result) {
|
||||
let code2 = result.code;
|
||||
if (useFastRefresh && refreshContentRE.test(code2)) {
|
||||
code2 = addRefreshWrapper(code2, id);
|
||||
}
|
||||
return {
|
||||
code: code2,
|
||||
map: result.map
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const viteReactRefresh = {
|
||||
name: "vite:react-refresh",
|
||||
enforce: "pre",
|
||||
config: () => ({
|
||||
resolve: {
|
||||
dedupe: ["react", "react-dom"]
|
||||
}
|
||||
}),
|
||||
resolveId(id) {
|
||||
if (id === runtimePublicPath) {
|
||||
return id;
|
||||
}
|
||||
},
|
||||
load(id) {
|
||||
if (id === runtimePublicPath) {
|
||||
return runtimeCode;
|
||||
}
|
||||
},
|
||||
transformIndexHtml() {
|
||||
if (!skipFastRefresh)
|
||||
return [
|
||||
{
|
||||
tag: "script",
|
||||
attrs: { type: "module" },
|
||||
children: preambleCode.replace(`__BASE__`, devBase)
|
||||
}
|
||||
];
|
||||
}
|
||||
};
|
||||
const reactJsxRuntimeId = "react/jsx-runtime";
|
||||
const reactJsxDevRuntimeId = "react/jsx-dev-runtime";
|
||||
const virtualReactJsxRuntimeId = "\0" + reactJsxRuntimeId;
|
||||
const virtualReactJsxDevRuntimeId = "\0" + reactJsxDevRuntimeId;
|
||||
const viteReactJsx = {
|
||||
name: "vite:react-jsx",
|
||||
enforce: "pre",
|
||||
config() {
|
||||
return {
|
||||
optimizeDeps: {
|
||||
// We can't add `react-dom` because the dependency is `react-dom/client`
|
||||
// for React 18 while it's `react-dom` for React 17. We'd need to detect
|
||||
// what React version the user has installed.
|
||||
include: [reactJsxRuntimeId, reactJsxDevRuntimeId, "react"]
|
||||
}
|
||||
};
|
||||
},
|
||||
resolveId(id, importer) {
|
||||
if (id === reactJsxRuntimeId && importer !== virtualReactJsxRuntimeId) {
|
||||
return virtualReactJsxRuntimeId;
|
||||
}
|
||||
if (id === reactJsxDevRuntimeId && importer !== virtualReactJsxDevRuntimeId) {
|
||||
return virtualReactJsxDevRuntimeId;
|
||||
}
|
||||
},
|
||||
load(id) {
|
||||
if (id === virtualReactJsxRuntimeId) {
|
||||
return [
|
||||
`import * as jsxRuntime from ${JSON.stringify(reactJsxRuntimeId)}`,
|
||||
`export const Fragment = jsxRuntime.Fragment`,
|
||||
`export const jsx = jsxRuntime.jsx`,
|
||||
`export const jsxs = jsxRuntime.jsxs`
|
||||
].join("\n");
|
||||
}
|
||||
if (id === virtualReactJsxDevRuntimeId) {
|
||||
return [
|
||||
`import * as jsxRuntime from ${JSON.stringify(reactJsxDevRuntimeId)}`,
|
||||
`export const Fragment = jsxRuntime.Fragment`,
|
||||
`export const jsxDEV = jsxRuntime.jsxDEV`
|
||||
].join("\n");
|
||||
}
|
||||
}
|
||||
};
|
||||
return [viteBabel, viteReactRefresh, useAutomaticRuntime && viteReactJsx];
|
||||
}
|
||||
viteReact.preambleCode = preambleCode;
|
||||
function loadPlugin(path2) {
|
||||
return import(path2).then((module) => module.default || module);
|
||||
}
|
||||
function createBabelOptions(rawOptions) {
|
||||
var _a;
|
||||
const babelOptions = {
|
||||
babelrc: false,
|
||||
configFile: false,
|
||||
...rawOptions
|
||||
};
|
||||
babelOptions.plugins || (babelOptions.plugins = []);
|
||||
babelOptions.presets || (babelOptions.presets = []);
|
||||
babelOptions.overrides || (babelOptions.overrides = []);
|
||||
babelOptions.parserOpts || (babelOptions.parserOpts = {});
|
||||
(_a = babelOptions.parserOpts).plugins || (_a.plugins = []);
|
||||
return babelOptions;
|
||||
}
|
||||
|
||||
export { viteReact as default };
|
||||
58
node_modules/@vitejs/plugin-react/dist/refreshUtils.js
generated
vendored
Normal file
58
node_modules/@vitejs/plugin-react/dist/refreshUtils.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
function debounce(fn, delay) {
|
||||
let handle
|
||||
return () => {
|
||||
clearTimeout(handle)
|
||||
handle = setTimeout(fn, delay)
|
||||
}
|
||||
}
|
||||
|
||||
/* eslint-disable no-undef */
|
||||
const enqueueUpdate = debounce(exports.performReactRefresh, 16)
|
||||
|
||||
// Taken from https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/lib/runtime/RefreshUtils.js#L141
|
||||
// This allows to resister components not detected by SWC like styled component
|
||||
function registerExportsForReactRefresh(filename, moduleExports) {
|
||||
for (const key in moduleExports) {
|
||||
if (key === '__esModule') continue
|
||||
const exportValue = moduleExports[key]
|
||||
if (exports.isLikelyComponentType(exportValue)) {
|
||||
exports.register(exportValue, filename + ' ' + key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function validateRefreshBoundaryAndEnqueueUpdate(prevExports, nextExports) {
|
||||
if (!predicateOnExport(prevExports, (key) => !!nextExports[key])) {
|
||||
return 'Could not Fast Refresh (export removed)'
|
||||
}
|
||||
|
||||
let hasExports = false
|
||||
const allExportsAreComponentsOrUnchanged = predicateOnExport(
|
||||
nextExports,
|
||||
(key, value) => {
|
||||
hasExports = true
|
||||
if (exports.isLikelyComponentType(value)) return true
|
||||
if (!prevExports[key]) return false
|
||||
return prevExports[key] === nextExports[key]
|
||||
},
|
||||
)
|
||||
if (hasExports && allExportsAreComponentsOrUnchanged) {
|
||||
enqueueUpdate()
|
||||
} else {
|
||||
return 'Could not Fast Refresh. Learn more at https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#consistent-components-exports'
|
||||
}
|
||||
}
|
||||
|
||||
function predicateOnExport(moduleExports, predicate) {
|
||||
for (const key in moduleExports) {
|
||||
if (key === '__esModule') continue
|
||||
const desc = Object.getOwnPropertyDescriptor(moduleExports, key)
|
||||
if (desc && desc.get) return false
|
||||
if (!predicate(key, moduleExports[key])) return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
exports.registerExportsForReactRefresh = registerExportsForReactRefresh
|
||||
exports.validateRefreshBoundaryAndEnqueueUpdate =
|
||||
validateRefreshBoundaryAndEnqueueUpdate
|
||||
51
node_modules/@vitejs/plugin-react/package.json
generated
vendored
Normal file
51
node_modules/@vitejs/plugin-react/package.json
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "@vitejs/plugin-react",
|
||||
"version": "3.1.0",
|
||||
"license": "MIT",
|
||||
"author": "Evan You",
|
||||
"contributors": [
|
||||
"Alec Larson",
|
||||
"Arnaud Barré"
|
||||
],
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.cjs"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "unbuild --stub",
|
||||
"build": "unbuild && pnpm run patch-cjs && tsx scripts/copyRefreshUtils.ts",
|
||||
"patch-cjs": "tsx ../../scripts/patchCJS.ts",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.18.0 || >=16.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vitejs/vite-plugin-react.git",
|
||||
"directory": "packages/plugin-react"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/vitejs/vite-plugin-react/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#readme",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.20.12",
|
||||
"@babel/plugin-transform-react-jsx-self": "^7.18.6",
|
||||
"@babel/plugin-transform-react-jsx-source": "^7.19.6",
|
||||
"magic-string": "^0.27.0",
|
||||
"react-refresh": "^0.14.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vite": "^4.1.0-beta.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user