Skip to content
This repository was archived by the owner on Sep 8, 2021. It is now read-only.

Commit 2ac4fa1

Browse files
committed
parallel build
1 parent 1397583 commit 2ac4fa1

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

index.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@ module.exports = (api, projectOptions) => {
88
const serveFn = serve.fn;
99
const webpackConfig = projectOptions.pluginOptions && projectOptions.pluginOptions.netlify && projectOptions.pluginOptions.netlify.webpackConfig;
1010

11-
build.fn = (...args) => {
12-
return buildFn(...args).then((res) => {
13-
return lambdaBuild
14-
.run("src/lambda", webpackConfig)
15-
.then(function(stats) {
16-
console.log(stats.toString({ color: true }))
17-
return res
18-
})
19-
.catch(function(err) {
20-
console.error(err)
21-
process.exit(1)
22-
})
23-
})
11+
build.fn = async (...args) => {
12+
try {
13+
const [res, stats] = await Promise.all([
14+
buildFn(...args),
15+
lambdaBuild.run('src/lambda', webpackConfig),
16+
]);
17+
console.log(stats.toString({ color: true }));
18+
return res;
19+
} catch (err) {
20+
console.error(err);
21+
process.exit(1);
22+
}
2423
}
2524

2625
serve.fn = (...args) => {

0 commit comments

Comments
 (0)