diff --git a/create-vite-express/templates/react-ts/package.json b/create-vite-express/templates/react-ts/package.json index c8819f8..9e4be83 100644 --- a/create-vite-express/templates/react-ts/package.json +++ b/create-vite-express/templates/react-ts/package.json @@ -12,6 +12,7 @@ "express": "^4.18.2", "react": "^18.2.0", "react-dom": "^18.2.0", + "tsx": "^4.3.0", "typescript": "^5.3.2", "vite-express": "*" }, @@ -22,7 +23,6 @@ "@types/react-dom": "^18.2.16", "@vitejs/plugin-react": "^4.2.0", "nodemon": "^3.0.1", - "tsx": "^4.3.0", "vite": "^5.0.2" } } diff --git a/create-vite-express/templates/vanilla-ts/package.json b/create-vite-express/templates/vanilla-ts/package.json index f718d85..a809684 100644 --- a/create-vite-express/templates/vanilla-ts/package.json +++ b/create-vite-express/templates/vanilla-ts/package.json @@ -3,8 +3,8 @@ "private": true, "version": "0.0.0", "scripts": { - "dev": "nodemon src/server/main.ts -w src/server", - "start": "NODE_ENV=production ts-node src/server/main.ts", + "dev": "nodemon -w src/server -x tsx src/server/main.ts", + "start": "NODE_ENV=production tsx src/server/main.ts", "build": "vite build" }, "devDependencies": { @@ -15,6 +15,7 @@ }, "dependencies": { "express": "^4.18.2", + "tsx": "^4.5.0", "typescript": "^5.3.2", "vite-express": "*" } diff --git a/create-vite-express/templates/vanilla/package.json b/create-vite-express/templates/vanilla/package.json index 0342538..6d9b67b 100644 --- a/create-vite-express/templates/vanilla/package.json +++ b/create-vite-express/templates/vanilla/package.json @@ -2,6 +2,7 @@ "name": "vite-starter", "private": true, "version": "0.0.0", + "type": "module", "scripts": { "dev": "nodemon src/server/main.js -w src/server", "start": "NODE_ENV=production node src/server/main.js", diff --git a/create-vite-express/templates/vanilla/src/server/main.js b/create-vite-express/templates/vanilla/src/server/main.js index 620f53b..9323e3f 100644 --- a/create-vite-express/templates/vanilla/src/server/main.js +++ b/create-vite-express/templates/vanilla/src/server/main.js @@ -1,5 +1,5 @@ -const express = require("express"); -const ViteExpress = require("vite-express"); +import express from "express"; +import ViteExpress from "vite-express"; const app = express();