nuxt-gin-tools 0.0.1 → 0.0.2
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/package.json +2 -1
- package/src/nuxt-config.d.ts +12 -0
- package/src/nuxt-config.js +19 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-gin-tools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"bin": {
|
|
6
6
|
"nuxt-gin": "index.js"
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/fs-extra": "^11.0.4",
|
|
23
23
|
"@types/node": "^24.0.14",
|
|
24
|
+
"nuxt": "^3.17.7",
|
|
24
25
|
"ts-node": "^10.9.2",
|
|
25
26
|
"typescript": "^5.8.3"
|
|
26
27
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NuxtConfig } from "nuxt/config";
|
|
2
|
+
/** API配置模式接口 */
|
|
3
|
+
export interface ServerConfig {
|
|
4
|
+
/** Gin框架端口 */
|
|
5
|
+
ginPort: number;
|
|
6
|
+
/** Nuxt框架devServer端口 */
|
|
7
|
+
nuxtPort: number;
|
|
8
|
+
/** Nuxt的BaseUrl,必须以/开头并包含至少一个单词字符 */
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const config: NuxtConfig;
|
|
12
|
+
export default config;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.config = void 0;
|
|
4
|
+
const fs_extra_1 = require("fs-extra");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const cwd = process.cwd();
|
|
7
|
+
const serverConfig = (0, fs_extra_1.readJSONSync)((0, path_1.resolve)(cwd, `server.config.json`));
|
|
8
|
+
exports.config = {
|
|
9
|
+
nitro: { devProxy: { "/api-go": { target: `http://localhost:${serverConfig.ginPort}/api-go`, changeOrigin: true } } },
|
|
10
|
+
vite: {
|
|
11
|
+
esbuild: { jsxFactory: "h", jsxFragment: "Fragment" },
|
|
12
|
+
},
|
|
13
|
+
rootDir: "vue",
|
|
14
|
+
ssr: false,
|
|
15
|
+
app: { baseURL: serverConfig.baseUrl },
|
|
16
|
+
devServer: { port: serverConfig.nuxtPort },
|
|
17
|
+
experimental: { payloadExtraction: false },
|
|
18
|
+
};
|
|
19
|
+
exports.default = exports.config;
|