only copy .mjs files from from storybook/manager/dist in manager-builder

This commit is contained in:
Norbert de Langen 2022-10-27 13:03:27 +02:00
parent 2c628b11da
commit f8dabf5a3c
No known key found for this signature in database
GPG Key ID: FD0E78AF9A837762

View File

@ -1,4 +1,4 @@
import { dirname, join } from 'path';
import { dirname, join, parse } from 'path';
import fs from 'fs-extra';
import express from 'express';
@ -192,7 +192,15 @@ const builder: BuilderFunction = async function* builderGeneratorFn({ startTime,
yield;
const managerFiles = fs.copy(coreDirOrigin, coreDirTarget);
const managerFiles = fs.copy(coreDirOrigin, coreDirTarget, {
filter: (src) => {
const { ext } = parse(src);
if (ext) {
return ext === '.mjs';
}
return true;
},
});
const { cssFiles, jsFiles } = await readOrderedFiles(addonsDir, compilation?.outputFiles);
yield;