nitropack-nightly 2.11.0-20250301-081015.fcba06e1 → 2.11.0-20250301-231416.f56ead19
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/core/index.mjs +4 -3
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/meta/index.mjs +1 -1
- package/dist/rollup/index.mjs +11 -10
- package/package.json +1 -1
package/dist/core/index.mjs
CHANGED
|
@@ -2154,8 +2154,8 @@ class NodeDevWorker {
|
|
|
2154
2154
|
handleEvent(event) {
|
|
2155
2155
|
if (!this.#address || !this.#proxy) {
|
|
2156
2156
|
throw createError({
|
|
2157
|
-
|
|
2158
|
-
|
|
2157
|
+
status: 503,
|
|
2158
|
+
statusText: "Dev worker is unavailable"
|
|
2159
2159
|
});
|
|
2160
2160
|
}
|
|
2161
2161
|
return this.#proxy.handleEvent(event, { target: this.#address });
|
|
@@ -2741,7 +2741,7 @@ $1`
|
|
|
2741
2741
|
return new Response(
|
|
2742
2742
|
JSON.stringify(
|
|
2743
2743
|
{
|
|
2744
|
-
error: "
|
|
2744
|
+
error: "Dev server is unavailable.",
|
|
2745
2745
|
hint: "Please reload the page and check the console for errors if the issue persists."
|
|
2746
2746
|
},
|
|
2747
2747
|
null,
|
|
@@ -2749,6 +2749,7 @@ $1`
|
|
|
2749
2749
|
),
|
|
2750
2750
|
{
|
|
2751
2751
|
status: 503,
|
|
2752
|
+
statusText: "Dev server is unavailable",
|
|
2752
2753
|
headers: {
|
|
2753
2754
|
"Content-Type": "application/json",
|
|
2754
2755
|
"Cache-Control": "no-store",
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
package/dist/meta/index.mjs
CHANGED
package/dist/rollup/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { builtinModules, createRequire } from 'node:module';
|
|
2
2
|
import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
3
|
+
import { isAbsolute as isAbsolute$1 } from 'node:path';
|
|
3
4
|
import alias from '@rollup/plugin-alias';
|
|
4
5
|
import commonjs from '@rollup/plugin-commonjs';
|
|
5
6
|
import inject from '@rollup/plugin-inject';
|
|
@@ -366,14 +367,14 @@ function printWarnings(id, result, plugin) {
|
|
|
366
367
|
|
|
367
368
|
function externals$1(opts) {
|
|
368
369
|
const trackedExternals = /* @__PURE__ */ new Set();
|
|
369
|
-
const tryResolve = (id) => {
|
|
370
|
+
const tryResolve = (id, importer) => {
|
|
370
371
|
if (id.startsWith("\0")) {
|
|
371
372
|
return id;
|
|
372
373
|
}
|
|
373
374
|
const res = resolveModuleURL(id, {
|
|
374
375
|
try: true,
|
|
375
376
|
conditions: opts.exportConditions,
|
|
376
|
-
from: opts.moduleDirectories,
|
|
377
|
+
from: importer && isAbsolute(importer) ? [pathToFileURL(importer), ...opts.moduleDirectories] : opts.moduleDirectories,
|
|
377
378
|
suffixes: ["", "/index"],
|
|
378
379
|
extensions: [".mjs", ".cjs", ".js", ".mts", ".cts", ".ts", ".json"]
|
|
379
380
|
});
|
|
@@ -411,7 +412,7 @@ function externals$1(opts) {
|
|
|
411
412
|
return null;
|
|
412
413
|
}
|
|
413
414
|
if (!isAbsolute(resolved.id) || !existsSync(resolved.id) || await isDirectory(resolved.id)) {
|
|
414
|
-
resolved.id = tryResolve(resolved.id) || resolved.id;
|
|
415
|
+
resolved.id = tryResolve(resolved.id, importer) || resolved.id;
|
|
415
416
|
}
|
|
416
417
|
if (!await isValidNodeImport(resolved.id).catch(() => false)) {
|
|
417
418
|
return null;
|
|
@@ -429,7 +430,7 @@ function externals$1(opts) {
|
|
|
429
430
|
}
|
|
430
431
|
if (pkgName !== originalId) {
|
|
431
432
|
if (!isAbsolute(originalId)) {
|
|
432
|
-
const fullPath = tryResolve(originalId);
|
|
433
|
+
const fullPath = tryResolve(originalId, importer);
|
|
433
434
|
if (fullPath) {
|
|
434
435
|
trackedExternals.add(fullPath);
|
|
435
436
|
return {
|
|
@@ -438,10 +439,10 @@ function externals$1(opts) {
|
|
|
438
439
|
};
|
|
439
440
|
}
|
|
440
441
|
}
|
|
441
|
-
const packageEntry = tryResolve(pkgName);
|
|
442
|
+
const packageEntry = tryResolve(pkgName, importer);
|
|
442
443
|
if (packageEntry !== id) {
|
|
443
444
|
const guessedSubpath = await lookupNodeModuleSubpath(id).catch(() => null);
|
|
444
|
-
const resolvedGuess = guessedSubpath && tryResolve(join(pkgName, guessedSubpath));
|
|
445
|
+
const resolvedGuess = guessedSubpath && tryResolve(join(pkgName, guessedSubpath), importer);
|
|
445
446
|
if (resolvedGuess === id) {
|
|
446
447
|
trackedExternals.add(resolvedGuess);
|
|
447
448
|
return {
|
|
@@ -2007,15 +2008,15 @@ export const plugins = [
|
|
|
2007
2008
|
if (nitro.options.noExternals) {
|
|
2008
2009
|
rollupConfig.plugins.push({
|
|
2009
2010
|
name: "no-externals",
|
|
2010
|
-
async resolveId(id,
|
|
2011
|
+
async resolveId(id, importer, resolveOpts) {
|
|
2011
2012
|
if (nitro.options.node && (id.startsWith("node:") || builtinModules.includes(id))) {
|
|
2012
2013
|
return { id, external: true };
|
|
2013
2014
|
}
|
|
2014
|
-
const resolved = await this.resolve(id,
|
|
2015
|
+
const resolved = await this.resolve(id, importer, resolveOpts);
|
|
2015
2016
|
if (!resolved) {
|
|
2016
2017
|
const _resolved = resolveModulePath(id, {
|
|
2017
2018
|
try: true,
|
|
2018
|
-
from: nitro.options.nodeModulesDirs,
|
|
2019
|
+
from: importer && isAbsolute$1(importer) ? [pathToFileURL(importer), ...nitro.options.nodeModulesDirs] : nitro.options.nodeModulesDirs,
|
|
2019
2020
|
suffixes: ["", "/index"],
|
|
2020
2021
|
extensions: [".mjs", ".cjs", ".js", ".mts", ".cts", ".ts", ".json"],
|
|
2021
2022
|
conditions: [
|
|
@@ -2033,7 +2034,7 @@ export const plugins = [
|
|
|
2033
2034
|
if (!resolved || resolved.external && !id.endsWith(".wasm")) {
|
|
2034
2035
|
throw new Error(
|
|
2035
2036
|
`Cannot resolve ${JSON.stringify(id)} from ${JSON.stringify(
|
|
2036
|
-
|
|
2037
|
+
importer
|
|
2037
2038
|
)} and externals are not allowed!`
|
|
2038
2039
|
);
|
|
2039
2040
|
}
|
package/package.json
CHANGED