-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix static glob to not clobber other transforms
- Loading branch information
Showing
2 changed files
with
8 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import { promisify } from 'node:util' | ||
import cpx from 'cpx2' | ||
const copy = promisify(cpx.copy) | ||
const copy = cpx.copy | ||
|
||
export function getCopyGlob (src) { | ||
return `${src}/**/*.!(js|css|html|md)` | ||
return `${src}/**/!(*.js|*.css|*.html|*.md)` | ||
} | ||
|
||
/** | ||
* run CPX2 on src folder | ||
*/ | ||
export function buildStatic (src, dest, opts = {}) { | ||
return copy(getCopyGlob(src), dest, { ignore: opts.ignore }) | ||
export async function buildStatic (src, dest, opts = {}) { | ||
return await copy(getCopyGlob(src), dest, { ignore: opts.ignore }) | ||
} |