Docker build: Pre-compile public libraries

This commit is contained in:
Cohee 2025-01-03 12:30:55 +00:00
parent 02900520c9
commit dd273a7727
3 changed files with 12 additions and 1 deletions

View File

@ -27,6 +27,11 @@ RUN \
ln -s "./config/config.yaml" "config.yaml" || true && \
mkdir "config" || true
# Pre-compile public libraries
RUN \
echo "*** Run Webpack ***" && \
node "./docker/build-lib.js"
# Cleanup unnecessary files
RUN \
echo "*** Cleanup ***" && \

4
docker/build-lib.js Normal file
View File

@ -0,0 +1,4 @@
import getWebpackServeMiddleware from '../src/middleware/webpack-serve.js';
const middleware = getWebpackServeMiddleware();
await middleware.runWebpackCompiler();

View File

@ -36,7 +36,9 @@ export default function getWebpackServeMiddleware() {
console.log(output);
console.log();
}
resolve();
compiler.close(() => {
resolve();
});
});
});
};