From f8dabf5a3cf06eeb0bc438335a8e123b9757467a Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 27 Oct 2022 13:03:27 +0200 Subject: [PATCH] only copy .mjs files from from storybook/manager/dist in manager-builder --- code/lib/builder-manager/src/index.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/code/lib/builder-manager/src/index.ts b/code/lib/builder-manager/src/index.ts index af89cf0cdbed..8ce561bb0533 100644 --- a/code/lib/builder-manager/src/index.ts +++ b/code/lib/builder-manager/src/index.ts @@ -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;