Don't bundle backend-core if there is no pro loaded
This commit is contained in:
parent
b488dd06a3
commit
9334e1d4b9
|
@ -18,6 +18,18 @@ var argv = require("minimist")(process.argv.slice(2))
|
|||
function runBuild(entry, outfile) {
|
||||
const isDev = process.env.NODE_ENV !== "production"
|
||||
const tsconfig = argv["p"] || `tsconfig.build.json`
|
||||
const tsconfigPathPluginContent = JSON.parse(
|
||||
fs.readFileSync(tsconfig, "utf-8")
|
||||
)
|
||||
|
||||
if (!fs.existsSync("../pro/src")) {
|
||||
delete tsconfigPathPluginContent.compilerOptions.paths[
|
||||
"@budibase/backend-core"
|
||||
]
|
||||
delete tsconfigPathPluginContent.compilerOptions.paths[
|
||||
"@budibase/backend-core/*"
|
||||
]
|
||||
}
|
||||
|
||||
const sharedConfig = {
|
||||
entryPoints: [entry],
|
||||
|
@ -25,7 +37,10 @@ function runBuild(entry, outfile) {
|
|||
minify: !isDev,
|
||||
sourcemap: isDev,
|
||||
tsconfig,
|
||||
plugins: [TsconfigPathsPlugin({ tsconfig }), nodeExternalsPlugin()],
|
||||
plugins: [
|
||||
TsconfigPathsPlugin({ tsconfig: tsconfigPathPluginContent }),
|
||||
nodeExternalsPlugin(),
|
||||
],
|
||||
target: "node14",
|
||||
preserveSymlinks: true,
|
||||
loader: {
|
||||
|
|
Loading…
Reference in New Issue