Skip to content

Commit

Permalink
Merge pull request #19647 from storybookjs/tech/only-copy-mjs-to-mana…
Browse files Browse the repository at this point in the history
…ger-outpout

Build-storybook: Only copy .mjs files for manager build
  • Loading branch information
shilman authored Oct 27, 2022
2 parents bd687f2 + f8dabf5 commit da4bf6e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions code/lib/builder-manager/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { dirname, join } from 'path';
import { dirname, join, parse } from 'path';
import fs from 'fs-extra';
import express from 'express';

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit da4bf6e

Please sign in to comment.