Skip to content

Commit

Permalink
Merge pull request #6 from universal-ember/need-to-support-directorie…
Browse files Browse the repository at this point in the history
…s-only-for-convention-based-structures

Need to support directory-only manifests for convention based docs
  • Loading branch information
NullVoxPopuli committed Dec 26, 2023
2 parents 898752b + f4eacc5 commit ff425eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugins/create-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import { createUnplugin } from 'unplugin';
*
*/
export const createManifest = createUnplugin((options) => {
let { src, dest, name, include, exclude } = options ?? {};
let { src, dest, name, include, exclude, onlyDirectories } = options ?? {};

dest ??= src;
name ??= 'manifest.json';
include ??= '**/*';
exclude ??= [];
onlyDirectories ??= false;

return {
name: 'create-manifest',
Expand All @@ -20,6 +21,7 @@ export const createManifest = createUnplugin((options) => {
let paths = globbySync(include, {
cwd: path.join(process.cwd(), src),
expandDirectories: true,
onlyDirectories,
});

paths = paths.filter((path) => !exclude.some((pattern) => path.match(pattern)));
Expand Down

0 comments on commit ff425eb

Please sign in to comment.