Skip to content

Commit

Permalink
Merge pull request #15371 from Budibase/exclude-sourcemaps-from-pro
Browse files Browse the repository at this point in the history
Add string logging
  • Loading branch information
adrinr authored Jan 15, 2025
2 parents bd9a26b + 1be1787 commit 53b9da4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/pro
Submodule pro updated from a4f63b to 43a578
17 changes: 11 additions & 6 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -58,7 +61,7 @@ async function runBuild(entry, outfile) {
entryPoints: [entry],
bundle: true,
minify: !isDev,
sourcemap: isDev,
sourcemap: tsconfigPathPluginContent.compilerOptions.sourceMap,
tsconfig,
plugins: [
svelteCompilePlugin,
Expand Down Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"declaration": true,
"isolatedModules": true,
"baseUrl": ".",
"sourceMap": true,
"paths": {
"@budibase/types": ["./packages/types/src"],
"@budibase/backend-core": ["./packages/backend-core/src"],
Expand Down

0 comments on commit 53b9da4

Please sign in to comment.