From adc0c5958044d9224b4afa47a4825430e614e0ab Mon Sep 17 00:00:00 2001 From: vrtnd Date: Thu, 28 Nov 2024 18:54:29 +0300 Subject: [PATCH] fix build --- package.json | 5 ++--- vite.config.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9cb84e96..c9dcfb42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,5 @@ { "name": "bridges-server", - "type": "module", "scripts": { "deploy:prod": "sls deploy --stage prod", "serve": "sls offline start", @@ -14,8 +13,8 @@ "clean": "rimraf dist", "dev": "vite", "build": "vite build", - "start": "pm2 start dist/index.cjs --name bridges-server", - "start:dev": "pm2 start dist/index.cjs --name bridges-server --watch", + "start": "pm2 start dist/index.js --name bridges-server", + "start:dev": "pm2 start dist/index.js --name bridges-server --watch", "stop": "pm2 stop bridges-server", "restart": "pm2 restart bridges-server", "logs": "pm2 logs bridges-server", diff --git a/vite.config.ts b/vite.config.ts index 8ef2984e..b83544a1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,7 +6,7 @@ export default defineConfig({ lib: { entry: path.resolve(__dirname, "src/server/index.ts"), formats: ["cjs"], - fileName: () => "index.js", + fileName: () => "index.cjs", }, rollupOptions: { external: ["fastify", "@fastify/cors", ...Object.keys(require("./package.json").dependencies)],