nitro-nightly 3.0.1-20251110-093536-c21a33ba → 3.0.1-20251110-102933-36971ba8
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/_build/common2.mjs +19 -0
- package/dist/_build/rollup.mjs +0 -18
- package/dist/_build/vite.plugin.mjs +3 -1
- package/package.json +1 -1
package/dist/_build/common2.mjs
CHANGED
|
@@ -664,6 +664,24 @@ function nitroResolveIds() {
|
|
|
664
664
|
};
|
|
665
665
|
}
|
|
666
666
|
|
|
667
|
+
//#endregion
|
|
668
|
+
//#region src/build/plugins/sourcemap-min.ts
|
|
669
|
+
function sourcemapMinify() {
|
|
670
|
+
return {
|
|
671
|
+
name: "nitro:sourcemap-minify",
|
|
672
|
+
generateBundle(_options, bundle) {
|
|
673
|
+
for (const [key, asset] of Object.entries(bundle)) {
|
|
674
|
+
if (!key.endsWith(".map") || !("source" in asset) || typeof asset.source !== "string") continue;
|
|
675
|
+
const sourcemap = JSON.parse(asset.source);
|
|
676
|
+
delete sourcemap.sourcesContent;
|
|
677
|
+
delete sourcemap.x_google_ignoreList;
|
|
678
|
+
if ((sourcemap.sources || []).some((s) => s.includes("node_modules"))) sourcemap.mappings = "";
|
|
679
|
+
asset.source = JSON.stringify(sourcemap);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
|
|
667
685
|
//#endregion
|
|
668
686
|
//#region src/build/plugins.ts
|
|
669
687
|
function baseBuildPlugins(nitro, base) {
|
|
@@ -708,6 +726,7 @@ function baseBuildPlugins(nitro, base) {
|
|
|
708
726
|
exportConditions: nitro.options.exportConditions,
|
|
709
727
|
writePackageJson: true
|
|
710
728
|
})));
|
|
729
|
+
if (nitro.options.sourcemap && !nitro.options.dev && nitro.options.experimental.sourcemapMinify !== false) plugins.push(sourcemapMinify());
|
|
711
730
|
return plugins;
|
|
712
731
|
}
|
|
713
732
|
|
package/dist/_build/rollup.mjs
CHANGED
|
@@ -72,23 +72,6 @@ function oxc(options) {
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
//#endregion
|
|
76
|
-
//#region src/build/plugins/sourcemap-min.ts
|
|
77
|
-
function sourcemapMinify() {
|
|
78
|
-
return {
|
|
79
|
-
name: "nitro:sourcemap-minify",
|
|
80
|
-
generateBundle(_options, bundle) {
|
|
81
|
-
for (const [key, asset] of Object.entries(bundle)) {
|
|
82
|
-
if (!key.endsWith(".map") || !("source" in asset) || typeof asset.source !== "string") continue;
|
|
83
|
-
const sourcemap = JSON.parse(asset.source);
|
|
84
|
-
if (!(sourcemap.sources || []).some((s) => s.includes("node_modules"))) continue;
|
|
85
|
-
sourcemap.mappings = "";
|
|
86
|
-
asset.source = JSON.stringify(sourcemap);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
75
|
//#endregion
|
|
93
76
|
//#region src/build/rollup/config.ts
|
|
94
77
|
const getRollupConfig = (nitro) => {
|
|
@@ -184,7 +167,6 @@ const getRollupConfig = (nitro) => {
|
|
|
184
167
|
};
|
|
185
168
|
config = defu(nitro.options.rollupConfig, config);
|
|
186
169
|
if (config.output.inlineDynamicImports) delete config.output.manualChunks;
|
|
187
|
-
if (nitro.options.sourcemap && !nitro.options.dev && nitro.options.experimental.sourcemapMinify !== false) config.plugins.push(sourcemapMinify());
|
|
188
170
|
return config;
|
|
189
171
|
};
|
|
190
172
|
|
|
@@ -29,7 +29,7 @@ import { spawn } from "node:child_process";
|
|
|
29
29
|
* - nodeResolve
|
|
30
30
|
* - commonjs
|
|
31
31
|
* - esbuild
|
|
32
|
-
* -
|
|
32
|
+
* - sourcemapMinify
|
|
33
33
|
* - json
|
|
34
34
|
* - raw
|
|
35
35
|
*
|
|
@@ -375,6 +375,7 @@ function createNitroEnvironment(ctx) {
|
|
|
375
375
|
rollupOptions: ctx.rollupConfig.config,
|
|
376
376
|
minify: ctx.nitro.options.minify,
|
|
377
377
|
emptyOutDir: false,
|
|
378
|
+
sourcemap: ctx.nitro.options.sourcemap,
|
|
378
379
|
commonjsOptions: { ...ctx.nitro.options.commonJS }
|
|
379
380
|
},
|
|
380
381
|
resolve: {
|
|
@@ -391,6 +392,7 @@ function createServiceEnvironment(ctx, name, serviceConfig) {
|
|
|
391
392
|
build: {
|
|
392
393
|
rollupOptions: { input: serviceConfig.entry },
|
|
393
394
|
minify: ctx.nitro.options.minify,
|
|
395
|
+
sourcemap: ctx.nitro.options.sourcemap,
|
|
394
396
|
outDir: join(ctx.nitro.options.buildDir, "vite/services", name),
|
|
395
397
|
emptyOutDir: true
|
|
396
398
|
},
|
package/package.json
CHANGED