Use esbuild for jsrunner

This commit is contained in:
Adria Navarro 2024-01-15 12:30:47 +01:00
parent 7186addb5c
commit eb69b36aac
3 changed files with 15 additions and 4 deletions

View File

@ -181,6 +181,16 @@
"target": "build" "target": "build"
} }
] ]
},
"test": {
"dependsOn": [
{
"projects": [
"@budibase/string-templates"
],
"target": "build:esbuild"
}
]
} }
} }
} }

View File

@ -3,10 +3,10 @@ import env from "./environment"
import { setJSRunner } from "@budibase/string-templates" import { setJSRunner } from "@budibase/string-templates"
import { context } from "@budibase/backend-core" import { context } from "@budibase/backend-core"
import tracer from "dd-trace" import tracer from "dd-trace"
import { readFileSync } from "fs" import fs from "fs"
const helpersSource = readFileSync( const helpersSource = fs.readFileSync(
"node_modules/@budibase/string-templates/dist/bundle.mjs", `${require.resolve("@budibase/string-templates/index-helpers")}`,
"utf8" "utf8"
) )

View File

@ -11,7 +11,8 @@
"require": "./src/index.cjs", "require": "./src/index.cjs",
"import": "./dist/bundle.mjs" "import": "./dist/bundle.mjs"
}, },
"./package.json": "./package.json" "./package.json": "./package.json",
"./index-helpers": "./dist/index-helpers.bundled.js"
}, },
"files": [ "files": [
"dist", "dist",