This commit is contained in:
@ -6,6 +6,10 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./src/index.ts",
|
||||
"types": "./src/index.ts"
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsup src/index.ts --format cjs,esm --dts"
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import express from "express";
|
||||
import express, { Express } from "express";
|
||||
|
||||
type ServerType = {
|
||||
/**
|
||||
@ -10,7 +10,7 @@ type ServerType = {
|
||||
onLoaded?: () => void;
|
||||
};
|
||||
|
||||
export function createServer({ port = 3000, onLoaded }: ServerType) {
|
||||
export function createServer({ port = 3000, onLoaded }: ServerType): Express {
|
||||
if (typeof port === "string") {
|
||||
port = Number(port);
|
||||
if (isNaN(port)) {
|
||||
|
@ -14,5 +14,5 @@
|
||||
"noEmit": true,
|
||||
"lib": ["es2022", "dom", "dom.iterable"]
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
@ -6,6 +6,10 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./src/index.ts",
|
||||
"types": "./src/index.ts"
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsup src/index.ts --format cjs,esm --dts"
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"extends": "tsconfig/server.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
}
|
||||
"extends": "tsconfig/server.json"
|
||||
// "compilerOptions": {
|
||||
// "outDir": "dist",
|
||||
// "rootDir": "src"
|
||||
// }
|
||||
}
|
||||
|
Reference in New Issue
Block a user