diff --git a/.gitignore b/.gitignore index 6a9f8063929462..44abdd7bf563db 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store node_modules +!**/glob-import/dir/node_modules dist dist-ssr TODOs.md diff --git a/packages/playground/glob-import/__tests__/glob-import.spec.ts b/packages/playground/glob-import/__tests__/glob-import.spec.ts index 311f94cd00571a..3a2425736548ea 100644 --- a/packages/playground/glob-import/__tests__/glob-import.spec.ts +++ b/packages/playground/glob-import/__tests__/glob-import.spec.ts @@ -45,6 +45,10 @@ const allResult = { } } +const nodeModulesResult = { + '/dir/node_modules/hoge.js': { msg: 'hoge' } +} + const rawResult = { '/dir/baz.json': { msg: 'baz' @@ -55,6 +59,9 @@ test('should work', async () => { expect(await page.textContent('.result')).toBe( JSON.stringify(allResult, null, 2) ) + expect(await page.textContent('.result-node_modules')).toBe( + JSON.stringify(nodeModulesResult, null, 2) + ) }) test('import glob raw', async () => { diff --git a/packages/playground/glob-import/dir/node_modules/hoge.js b/packages/playground/glob-import/dir/node_modules/hoge.js new file mode 100644 index 00000000000000..874eb4312f0dc5 --- /dev/null +++ b/packages/playground/glob-import/dir/node_modules/hoge.js @@ -0,0 +1 @@ +export const msg = 'hoge' diff --git a/packages/playground/glob-import/index.html b/packages/playground/glob-import/index.html index e408ec8adda602..bb5e2f3c18f752 100644 --- a/packages/playground/glob-import/index.html +++ b/packages/playground/glob-import/index.html @@ -1,8 +1,30 @@

+