fix(dockerfile): copy necessary file when building (#8008)

* fix(dockerfile): copy necessary file when building

*when even bother deleting file...

* no console
This commit is contained in:
NeverBehave
2021-08-13 03:44:39 -07:00
committed by GitHub
parent 2bfbaf3bdc
commit c0b638c860
6 changed files with 23 additions and 423 deletions

View File

@@ -0,0 +1,18 @@
/* eslint-disable no-console */
const fs = require('fs-extra');
const path = require('path');
const { nodeFileTrace } = require('@vercel/nft');
const files = ['lib/index.js', 'api/now.js'];
const resultFolder = "app-minimal";
(async () => {
console.log("Start analyizing...");
const { fileList } = await nodeFileTrace(files, {
base: path.resolve(path.join(__dirname, '../..')),
});
console.log("Total files need to be copy: " + fileList.length);
return Promise.all(
fileList.map((e) => fs.copy(e, path.resolve(path.join(resultFolder, e))))
);
})();