@edgeone/nuxt-pages 1.0.6 → 1.0.7
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/index.js +12 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
return createRequire(import.meta.url);
|
|
5
5
|
})();
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
addNitroBuildOutputConfig,
|
|
9
|
-
resetNitroConfig
|
|
10
|
-
} from "./esm-chunks/chunk-7JK67XZ2.js";
|
|
11
7
|
import {
|
|
12
8
|
createServerHandler,
|
|
13
9
|
patchNitroHandler
|
|
14
10
|
} from "./esm-chunks/chunk-QG7JLDXY.js";
|
|
15
11
|
import "./esm-chunks/chunk-NJ4SUJNF.js";
|
|
12
|
+
import {
|
|
13
|
+
addNitroBuildOutputConfig,
|
|
14
|
+
resetNitroConfig
|
|
15
|
+
} from "./esm-chunks/chunk-7JK67XZ2.js";
|
|
16
16
|
import "./esm-chunks/chunk-V2LFVP3C.js";
|
|
17
17
|
import {
|
|
18
18
|
PluginContext
|
|
@@ -26,6 +26,8 @@ import "./esm-chunks/chunk-6BT4RYQJ.js";
|
|
|
26
26
|
|
|
27
27
|
// src/index.ts
|
|
28
28
|
import { rm } from "node:fs/promises";
|
|
29
|
+
import { join } from "node:path";
|
|
30
|
+
import { existsSync } from "node:fs";
|
|
29
31
|
function checkNuxtVersion(version) {
|
|
30
32
|
const versionData = version.split(".");
|
|
31
33
|
if (versionData.length === 3 && Number(versionData[0]) < 3) {
|
|
@@ -36,6 +38,11 @@ function checkNuxtVersion(version) {
|
|
|
36
38
|
var removeServerHandler = async (ctx) => {
|
|
37
39
|
await rm(ctx.serverHandlerDir, { recursive: true, force: true });
|
|
38
40
|
};
|
|
41
|
+
var removeIndexMJS = async (ctx) => {
|
|
42
|
+
if (existsSync(join(ctx.serverHandlerDir, "index.mjs"))) {
|
|
43
|
+
await rm(join(ctx.serverHandlerDir, "index.mjs"), { force: true });
|
|
44
|
+
}
|
|
45
|
+
};
|
|
39
46
|
var recordOldNitroConfig = null;
|
|
40
47
|
var onPreBuild = async (options) => {
|
|
41
48
|
try {
|
|
@@ -61,6 +68,7 @@ var onPostBuild = async (options) => {
|
|
|
61
68
|
const ctx = new PluginContext(options);
|
|
62
69
|
if (recordOldNitroConfig) {
|
|
63
70
|
await resetNitroConfig(recordOldNitroConfig.oldOutput, recordOldNitroConfig.oldPreset);
|
|
71
|
+
await removeIndexMJS(ctx);
|
|
64
72
|
}
|
|
65
73
|
};
|
|
66
74
|
export {
|