diff --git a/src/analyze.ts b/src/analyze.ts index 1b4261ad..c7fd9b7d 100644 --- a/src/analyze.ts +++ b/src/analyze.ts @@ -245,7 +245,7 @@ export default async function analyze(id: string, code: string, job: Job): Promi if (job.log) console.log('Globbing ' + assetDirPath + wildcardPattern); const files = (await new Promise((resolve, reject) => - glob(assetDirPath + wildcardPattern, { mark: true, ignore: assetDirPath + '/**/node_modules/**/*' }, (err, files) => err ? reject(err) : resolve(files)) + glob(assetDirPath + wildcardPattern, { mark: true, ignore: assetDirPath + '/**/node_modules/**/*', dot: true }, (err, files) => err ? reject(err) : resolve(files)) )); files .filter(name => diff --git a/src/utils/sharedlib-emit.ts b/src/utils/sharedlib-emit.ts index b4f70a0c..4e78e201 100644 --- a/src/utils/sharedlib-emit.ts +++ b/src/utils/sharedlib-emit.ts @@ -23,7 +23,7 @@ export async function sharedLibEmit(path: string, job: Job) { return; const files = await new Promise((resolve, reject) => - glob(pkgPath + sharedlibGlob, { ignore: pkgPath + '/**/node_modules/**/*' }, (err, files) => err ? reject(err) : resolve(files)) + glob(pkgPath + sharedlibGlob, { ignore: pkgPath + '/**/node_modules/**/*', dot: true }, (err, files) => err ? reject(err) : resolve(files)) ); await Promise.all(files.map(file => job.emitFile(file, 'sharedlib', path))); }; diff --git a/test/unit/glob-dot/input.js b/test/unit/glob-dot/input.js new file mode 100644 index 00000000..490ec964 --- /dev/null +++ b/test/unit/glob-dot/input.js @@ -0,0 +1,16 @@ +const fs = require('fs'); + +const dotFiles = fs.readdirSync( + __dirname, + 'with-dot' +) + +const nonDotFiles = fs.readdirSync( + __dirname, + 'without-dot' +) + +console.log({ + dotFiles, + nonDotFiles +}); diff --git a/test/unit/glob-dot/output.js b/test/unit/glob-dot/output.js new file mode 100644 index 00000000..1964e3d9 --- /dev/null +++ b/test/unit/glob-dot/output.js @@ -0,0 +1,7 @@ +[ + "package.json", + "test/unit/glob-dot/input.js", + "test/unit/glob-dot/output.js", + "test/unit/glob-dot/with-dot/.dot/first.txt", + "test/unit/glob-dot/without-dot/normal/first.txt" +] \ No newline at end of file diff --git a/test/unit/glob-dot/with-dot/.dot/first.txt b/test/unit/glob-dot/with-dot/.dot/first.txt new file mode 100644 index 00000000..b6fc4c62 --- /dev/null +++ b/test/unit/glob-dot/with-dot/.dot/first.txt @@ -0,0 +1 @@ +hello \ No newline at end of file diff --git a/test/unit/glob-dot/without-dot/normal/first.txt b/test/unit/glob-dot/without-dot/normal/first.txt new file mode 100644 index 00000000..b6fc4c62 --- /dev/null +++ b/test/unit/glob-dot/without-dot/normal/first.txt @@ -0,0 +1 @@ +hello \ No newline at end of file