mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-01 01:28:08 +08:00
In commit ad1a09597f, @vercel/nft is
updated to 0.17.0, and in this version fileList from nft is a set
instead of an array [1].
[1] https://github.com/vercel/nft/pull/240
17 lines
627 B
JavaScript
17 lines
627 B
JavaScript
/* 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: fileSet } = await nodeFileTrace(files, {
|
|
base: path.resolve(path.join(__dirname, '../..')),
|
|
});
|
|
const fileList = Array.from(fileSet);
|
|
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)))));
|
|
})();
|