Skip to content

Commit

Permalink
Fixup prepack build (based on promises)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgammon committed Jun 28, 2022
1 parent ffcc73c commit b46ea71
Showing 1 changed file with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,25 @@ open class GenerateEsBuildConfig : DefaultTask() {
]
};
console.info("Bundling SSR library '%%%LIBNAME%%%'...");
esbuild.build(
settings
).catch(() => process.exit(1));
const prepacked = Prepack.prepackFileSync([
'%%%OUTFILE%%%'
], {
compatibility: 'browser',
inlineExpressions: true,
timeout: 300 * 60 * 1000,
sourceMaps: false,
filename: 'ssr.js'
});
fs.writeFileSync('%%%PACKEDFILE%%%', prepacked.code, {
encoding: 'utf8'
});
).then(() => {
console.info("ESBuild bundle step complete. Packing SSR bundle with Prepack...");
const prepacked = Prepack.prepackFileSync([
'%%%OUTFILE%%%'
], {
compatibility: 'browser',
inlineExpressions: true,
timeout: 300 * 60 * 1000,
sourceMaps: false,
filename: 'ssr.js'
});
fs.writeFileSync('%%%PACKEDFILE%%%', prepacked.code, {
encoding: 'utf8'
});
}, () => process.exit(1));
""".trimIndent()

@get:Input
Expand Down

0 comments on commit b46ea71

Please sign in to comment.