nuxt-gin-tools 0.0.12 → 0.1.1
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/README.md +1 -1
- package/package.json +1 -1
- package/src/builder.js +2 -2
- package/src/cleanup.js +1 -1
- package/src/nuxt-config.d.ts +7 -0
- package/src/nuxt-config.js +10 -1
- package/src/pack.d.ts +1 -1
- package/src/pack.js +4 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# nuxt-gin-tools
|
|
2
2
|
|
|
3
|
-
This project is used as a dependency for [nuxt-gin-starter](https://github.com/RapboyGao/
|
|
3
|
+
This project is used as a dependency for [nuxt-gin-starter](https://github.com/RapboyGao/nuxt-gin-starter.git)
|
|
4
4
|
|
|
5
5
|
## Command: nuxt-gin dev
|
|
6
6
|
|
package/package.json
CHANGED
package/src/builder.js
CHANGED
|
@@ -10,10 +10,10 @@ const path_1 = require("path");
|
|
|
10
10
|
const cwd = process.cwd();
|
|
11
11
|
function build() {
|
|
12
12
|
(0, fs_extra_1.ensureDirSync)((0, path_1.join)(cwd, "vue/.output"));
|
|
13
|
-
(0, fs_extra_1.ensureFileSync)((0, path_1.join)(cwd, "
|
|
13
|
+
(0, fs_extra_1.ensureFileSync)((0, path_1.join)(cwd, ".server/production.exe"));
|
|
14
14
|
return (0, concurrently_1.default)([
|
|
15
15
|
{
|
|
16
|
-
command: "go build -o
|
|
16
|
+
command: "go build -o ./.server/production.exe .",
|
|
17
17
|
name: "go",
|
|
18
18
|
prefixColor: "green",
|
|
19
19
|
},
|
package/src/cleanup.js
CHANGED
package/src/nuxt-config.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const config: {
|
|
2
2
|
ssr: boolean;
|
|
3
3
|
buildDir: string;
|
|
4
|
+
srcDir: string;
|
|
4
5
|
/**
|
|
5
6
|
* 配置实验性功能
|
|
6
7
|
* 禁用 payloadExtraction 功能,该功能可能用于提取页面的有效负载数据
|
|
@@ -9,4 +10,10 @@ export declare const config: {
|
|
|
9
10
|
experimental: {
|
|
10
11
|
payloadExtraction: boolean;
|
|
11
12
|
};
|
|
13
|
+
devtools: {
|
|
14
|
+
timeline: {
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
12
18
|
};
|
|
19
|
+
export default config;
|
package/src/nuxt-config.js
CHANGED
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.config = void 0;
|
|
4
4
|
exports.config = {
|
|
5
5
|
ssr: false,
|
|
6
|
-
buildDir: "vue/.nuxt",
|
|
6
|
+
buildDir: "vue/.nuxt", // 设置构建目录为 "vue/.nuxt",表示 Nuxt 项目的构建输出将存放在该目录下
|
|
7
|
+
srcDir: "vue", // 设置源代码目录为 "vue",表示 Nuxt 项目的源代码将存放在该目录下
|
|
7
8
|
/**
|
|
8
9
|
* 配置实验性功能
|
|
9
10
|
* 禁用 payloadExtraction 功能,该功能可能用于提取页面的有效负载数据
|
|
@@ -12,4 +13,12 @@ exports.config = {
|
|
|
12
13
|
experimental: {
|
|
13
14
|
payloadExtraction: false,
|
|
14
15
|
},
|
|
16
|
+
// 配置 Nuxt DevTools
|
|
17
|
+
// 启用时间线功能,可能用于调试和性能分析
|
|
18
|
+
devtools: {
|
|
19
|
+
timeline: {
|
|
20
|
+
enabled: true,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
15
23
|
};
|
|
24
|
+
exports.default = exports.config;
|
package/src/pack.d.ts
CHANGED
package/src/pack.js
CHANGED
|
@@ -74,13 +74,13 @@ exports.ORIGINAL_DIST_PATH = Path.resolve(process.cwd(), "dist");
|
|
|
74
74
|
exports.PACKAGE_JSON_CONTENT = {
|
|
75
75
|
private: true,
|
|
76
76
|
scripts: {
|
|
77
|
-
start: "
|
|
77
|
+
start: "./.server/production.exe", // 定义启动命令
|
|
78
78
|
},
|
|
79
79
|
};
|
|
80
80
|
// 定义需要复制到构建目录的文件映射关系
|
|
81
81
|
exports.FILES_TO_COPY = {
|
|
82
82
|
"vue/.output": builtPath("vue/.output"), // Vue 应用构建输出
|
|
83
|
-
"
|
|
83
|
+
".server/production.exe": builtPath(".server/production.exe"), // 生产环境可执行文件
|
|
84
84
|
"server.config.json": builtPath("server.config.json"), // 服务器配置文件
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
@@ -90,9 +90,9 @@ function writeScriptFiles() {
|
|
|
90
90
|
// 写入 Windows 批处理启动脚本
|
|
91
91
|
FS.outputFileSync(builtPath("start.bat"), `powershell -ExecutionPolicy ByPass -File ./start.ps1`);
|
|
92
92
|
// 写入 PowerShell 启动脚本
|
|
93
|
-
FS.outputFileSync(builtPath("start.ps1"),
|
|
93
|
+
FS.outputFileSync(builtPath("start.ps1"), `./.server/production.exe`);
|
|
94
94
|
// 写入 Linux/macOS 启动脚本
|
|
95
|
-
FS.outputFileSync(builtPath("start.sh"),
|
|
95
|
+
FS.outputFileSync(builtPath("start.sh"), `./.server/production.exe`);
|
|
96
96
|
// 写入 package.json 文件,使用 2 个空格缩进
|
|
97
97
|
FS.outputJSONSync(builtPath("package.json"), exports.PACKAGE_JSON_CONTENT, { spaces: 2 });
|
|
98
98
|
}
|