vite 3.2.3 → 3.2.4
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/dist/node/chunks/{dep-7591464a.js → dep-2e4b3d45.js} +1 -1
- package/dist/node/chunks/{dep-51c4f80a.js → dep-67e7f8ab.js} +19 -14
- package/dist/node/cli.js +5 -5
- package/dist/node/constants.js +1 -1
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +1 -1
- package/dist/node-cjs/publicUtils.cjs +1 -1
- package/package.json +1 -1
|
@@ -12299,12 +12299,15 @@ function getHash(text) {
|
|
|
12299
12299
|
return createHash$2('sha256').update(text).digest('hex').substring(0, 8);
|
|
12300
12300
|
}
|
|
12301
12301
|
const requireResolveFromRootWithFallback = (root, id) => {
|
|
12302
|
+
const paths = _require$4.resolve.paths?.(id) || [];
|
|
12302
12303
|
// Search in the root directory first, and fallback to the default require paths.
|
|
12303
|
-
|
|
12304
|
-
|
|
12305
|
-
|
|
12306
|
-
|
|
12307
|
-
|
|
12304
|
+
paths.unshift(root);
|
|
12305
|
+
// Use `resolve` package to check existence first, so if the package is not found,
|
|
12306
|
+
// it won't be cached by nodejs, since there isn't a way to invalidate them:
|
|
12307
|
+
// https://github.com/nodejs/node/issues/44663
|
|
12308
|
+
resolve$5.sync(id, { basedir: root, paths });
|
|
12309
|
+
// Use `require.resolve` again as the `resolve` package doesn't support the `exports` field
|
|
12310
|
+
return _require$4.resolve(id, { paths });
|
|
12308
12311
|
};
|
|
12309
12312
|
// Based on node-graceful-fs
|
|
12310
12313
|
// The ISC License
|
|
@@ -33802,20 +33805,21 @@ function tryNodeResolve(id, importer, options, targetWeb, depsOptimizer, ssr, ex
|
|
|
33802
33805
|
if (!pkg || !nearestPkg) {
|
|
33803
33806
|
// if import can't be found, check if it's an optional peer dep.
|
|
33804
33807
|
// if so, we can resolve to a special id that errors only when imported.
|
|
33805
|
-
if (
|
|
33806
|
-
|
|
33807
|
-
!
|
|
33808
|
-
|
|
33808
|
+
if (!options.isHookNodeResolve &&
|
|
33809
|
+
basedir !== root && // root has no peer dep
|
|
33810
|
+
!isBuiltin(nestedPath) &&
|
|
33811
|
+
!nestedPath.includes('\0') &&
|
|
33812
|
+
bareImportRE.test(nestedPath)) {
|
|
33809
33813
|
// find package.json with `name` as main
|
|
33810
33814
|
const mainPackageJson = lookupFile(basedir, ['package.json'], {
|
|
33811
33815
|
predicate: (content) => !!JSON.parse(content).name
|
|
33812
33816
|
});
|
|
33813
33817
|
if (mainPackageJson) {
|
|
33814
33818
|
const mainPkg = JSON.parse(mainPackageJson);
|
|
33815
|
-
if (mainPkg.peerDependencies?.[
|
|
33816
|
-
mainPkg.peerDependenciesMeta?.[
|
|
33819
|
+
if (mainPkg.peerDependencies?.[nestedPath] &&
|
|
33820
|
+
mainPkg.peerDependenciesMeta?.[nestedPath]?.optional) {
|
|
33817
33821
|
return {
|
|
33818
|
-
id: `${optionalPeerDepId}:${
|
|
33822
|
+
id: `${optionalPeerDepId}:${nestedPath}:${mainPkg.name}`
|
|
33819
33823
|
};
|
|
33820
33824
|
}
|
|
33821
33825
|
}
|
|
@@ -43782,7 +43786,7 @@ async function compileCSS(id, code, config, urlReplacer) {
|
|
|
43782
43786
|
}));
|
|
43783
43787
|
}
|
|
43784
43788
|
if (isModule) {
|
|
43785
|
-
postcssPlugins.unshift((await import('./dep-
|
|
43789
|
+
postcssPlugins.unshift((await import('./dep-2e4b3d45.js').then(function (n) { return n.i; })).default({
|
|
43786
43790
|
...modulesOptions,
|
|
43787
43791
|
// TODO: convert null to undefined (`null` should be removed from `CSSModulesOptions.localsConvention`)
|
|
43788
43792
|
localsConvention: modulesOptions?.localsConvention ?? undefined,
|
|
@@ -52997,7 +53001,8 @@ async function instantiateModule(url, server, context = { global }, urlStack = [
|
|
|
52997
53001
|
isBuild: true,
|
|
52998
53002
|
isProduction,
|
|
52999
53003
|
isRequire: true,
|
|
53000
|
-
root
|
|
53004
|
+
root,
|
|
53005
|
+
isHookNodeResolve: true
|
|
53001
53006
|
};
|
|
53002
53007
|
// Since dynamic imports can happen in parallel, we need to
|
|
53003
53008
|
// account for multiple pending deps and duplicate imports.
|
package/dist/node/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { performance } from 'node:perf_hooks';
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import { z as picocolors, v as createLogger, g as resolveConfig } from './chunks/dep-
|
|
3
|
+
import { z as picocolors, v as createLogger, g as resolveConfig } from './chunks/dep-67e7f8ab.js';
|
|
4
4
|
import { VERSION } from './constants.js';
|
|
5
5
|
import 'node:fs';
|
|
6
6
|
import 'node:path';
|
|
@@ -702,7 +702,7 @@ cli
|
|
|
702
702
|
filterDuplicateOptions(options);
|
|
703
703
|
// output structure is preserved even after bundling so require()
|
|
704
704
|
// is ok here
|
|
705
|
-
const { createServer } = await import('./chunks/dep-
|
|
705
|
+
const { createServer } = await import('./chunks/dep-67e7f8ab.js').then(function (n) { return n.D; });
|
|
706
706
|
try {
|
|
707
707
|
const server = await createServer({
|
|
708
708
|
root,
|
|
@@ -750,7 +750,7 @@ cli
|
|
|
750
750
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
751
751
|
.action(async (root, options) => {
|
|
752
752
|
filterDuplicateOptions(options);
|
|
753
|
-
const { build } = await import('./chunks/dep-
|
|
753
|
+
const { build } = await import('./chunks/dep-67e7f8ab.js').then(function (n) { return n.C; });
|
|
754
754
|
const buildOptions = cleanOptions(options);
|
|
755
755
|
try {
|
|
756
756
|
await build({
|
|
@@ -775,7 +775,7 @@ cli
|
|
|
775
775
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
776
776
|
.action(async (root, options) => {
|
|
777
777
|
filterDuplicateOptions(options);
|
|
778
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
778
|
+
const { optimizeDeps } = await import('./chunks/dep-67e7f8ab.js').then(function (n) { return n.B; });
|
|
779
779
|
try {
|
|
780
780
|
const config = await resolveConfig({
|
|
781
781
|
root,
|
|
@@ -800,7 +800,7 @@ cli
|
|
|
800
800
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
801
801
|
.action(async (root, options) => {
|
|
802
802
|
filterDuplicateOptions(options);
|
|
803
|
-
const { preview } = await import('./chunks/dep-
|
|
803
|
+
const { preview } = await import('./chunks/dep-67e7f8ab.js').then(function (n) { return n.E; });
|
|
804
804
|
try {
|
|
805
805
|
const server = await preview({
|
|
806
806
|
root,
|
package/dist/node/constants.js
CHANGED
package/dist/node/index.d.ts
CHANGED
|
@@ -1151,6 +1151,7 @@ export declare interface InternalResolveOptions extends Required<ResolveOptions>
|
|
|
1151
1151
|
ssrOptimizeCheck?: boolean;
|
|
1152
1152
|
getDepsOptimizer?: (ssr: boolean) => DepsOptimizer | undefined;
|
|
1153
1153
|
shouldExternalize?: (id: string) => boolean | undefined;
|
|
1154
|
+
isHookNodeResolve?: boolean;
|
|
1154
1155
|
}
|
|
1155
1156
|
|
|
1156
1157
|
export { InvalidatePayload }
|
package/dist/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as build, q as createFilter, v as createLogger, c as createServer, e as defineConfig, f as formatPostcssSourceMap, i as getDepOptimizationConfig, j as isDepsOptimizerEnabled, l as loadConfigFromFile, x as loadEnv, k as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, h as resolveBaseUrl, g as resolveConfig, y as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
|
1
|
+
export { b as build, q as createFilter, v as createLogger, c as createServer, e as defineConfig, f as formatPostcssSourceMap, i as getDepOptimizationConfig, j as isDepsOptimizerEnabled, l as loadConfigFromFile, x as loadEnv, k as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, h as resolveBaseUrl, g as resolveConfig, y as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-67e7f8ab.js';
|
|
2
2
|
export { VERSION as version } from './constants.js';
|
|
3
3
|
export { version as esbuildVersion } from 'esbuild';
|
|
4
4
|
export { VERSION as rollupVersion } from 'rollup';
|
|
@@ -31,7 +31,7 @@ var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$1);
|
|
|
31
31
|
var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);
|
|
32
32
|
var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);
|
|
33
33
|
|
|
34
|
-
var version = "3.2.
|
|
34
|
+
var version = "3.2.4";
|
|
35
35
|
|
|
36
36
|
const VERSION = version;
|
|
37
37
|
const VITE_PACKAGE_DIR = path$3.resolve(
|