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) {
|
function runBuild(entry, outfile) {
|
||||||
const isDev = process.env.NODE_ENV !== "production"
|
const isDev = process.env.NODE_ENV !== "production"
|
||||||
const tsconfig = argv["p"] || `tsconfig.build.json`
|
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 = {
|
const sharedConfig = {
|
||||||
entryPoints: [entry],
|
entryPoints: [entry],
|
||||||
|
@ -25,7 +37,10 @@ function runBuild(entry, outfile) {
|
||||||
minify: !isDev,
|
minify: !isDev,
|
||||||
sourcemap: isDev,
|
sourcemap: isDev,
|
||||||
tsconfig,
|
tsconfig,
|
||||||
plugins: [TsconfigPathsPlugin({ tsconfig }), nodeExternalsPlugin()],
|
plugins: [
|
||||||
|
TsconfigPathsPlugin({ tsconfig: tsconfigPathPluginContent }),
|
||||||
|
nodeExternalsPlugin(),
|
||||||
|
],
|
||||||
target: "node14",
|
target: "node14",
|
||||||
preserveSymlinks: true,
|
preserveSymlinks: true,
|
||||||
loader: {
|
loader: {
|
||||||
|
|
Loading…
Reference in New Issue