From bc5b4297a5e552db92dcd95e85aae7aec08c2da6 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 8 Aug 2023 18:56:07 +0300 Subject: [PATCH] Backend-core via esbuild --- packages/backend-core/package.json | 2 +- packages/backend-core/plugins.ts | 1 - packages/backend-core/scripts/build.js | 8 ++++++++ 3 files changed, 9 insertions(+), 2 deletions(-) delete mode 100644 packages/backend-core/plugins.ts create mode 100644 packages/backend-core/scripts/build.js diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 4631b090fe..25baccbe53 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -14,7 +14,7 @@ "scripts": { "prebuild": "rimraf dist/", "prepack": "cp package.json dist", - "build": "tsc -p tsconfig.build.json", + "build": "node ./scripts/build.js && tsc -p tsconfig.build.json --emitDeclarationOnly", "build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput", "check:types": "tsc -p tsconfig.json --noEmit --paths null", "test": "bash scripts/test.sh", diff --git a/packages/backend-core/plugins.ts b/packages/backend-core/plugins.ts deleted file mode 100644 index 33354eaf64..0000000000 --- a/packages/backend-core/plugins.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./src/plugin" diff --git a/packages/backend-core/scripts/build.js b/packages/backend-core/scripts/build.js new file mode 100644 index 0000000000..992513755a --- /dev/null +++ b/packages/backend-core/scripts/build.js @@ -0,0 +1,8 @@ +#!/usr/bin/node +const { join } = require("path") +const fs = require("fs") +const coreBuild = require("../../../scripts/build") + +coreBuild("./src/plugin/index.ts", "./dist/plugins.js") +coreBuild("./src/index.ts", "./dist/index.js") +coreBuild("./tests/index.ts", "./dist/tests.js")