diff --git a/packages/pro b/packages/pro index a4f63b2267..43a5785ccb 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit a4f63b22675e16dcdcaa4d9e83b298eee6466a07 +Subproject commit 43a5785ccb4f83ce929b29f05ea0a62199fcdf23 diff --git a/scripts/build.js b/scripts/build.js index a745f49cfb..0106421fe7 100755 --- a/scripts/build.js +++ b/scripts/build.js @@ -46,7 +46,10 @@ const svelteCompilePlugin = { let { argv } = require("yargs") async function runBuild(entry, outfile) { - const isDev = process.env.NODE_ENV !== "production" + const isDev = !process.env.CI + + console.log(`Building in mode dev mode: ${isDev}`) + const tsconfig = argv["p"] || `tsconfig.build.json` const { data: tsconfigPathPluginContent } = loadTsConfig( @@ -58,7 +61,7 @@ async function runBuild(entry, outfile) { entryPoints: [entry], bundle: true, minify: !isDev, - sourcemap: isDev, + sourcemap: tsconfigPathPluginContent.compilerOptions.sourceMap, tsconfig, plugins: [ svelteCompilePlugin, @@ -125,10 +128,12 @@ async function runBuild(entry, outfile) { await Promise.all([hbsFiles, mainBuild, oldClientVersions]) - fs.writeFileSync( - `dist/${path.basename(outfile)}.meta.json`, - JSON.stringify((await mainBuild).metafile) - ) + if (isDev) { + fs.writeFileSync( + `dist/${path.basename(outfile)}.meta.json`, + JSON.stringify((await mainBuild).metafile) + ) + } console.log( "\x1b[32m%s\x1b[0m", diff --git a/tsconfig.build.json b/tsconfig.build.json index a05fa2c976..0e22ddf964 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -11,6 +11,7 @@ "declaration": true, "isolatedModules": true, "baseUrl": ".", + "sourceMap": true, "paths": { "@budibase/types": ["./packages/types/src"], "@budibase/backend-core": ["./packages/backend-core/src"],