From f4f0100649220453d961b6c66531c58026885680 Mon Sep 17 00:00:00 2001 From: Harsh Pandey Date: Fri, 23 Jul 2021 17:46:18 -0400 Subject: [PATCH] Handle imports from dot directories (#3739) Co-authored-by: patak --- packages/playground/optimize-deps/.hidden-dir/foo.js | 1 + .../optimize-deps/__tests__/optimize-deps.spec.ts | 4 ++++ packages/playground/optimize-deps/index.html | 6 ++++++ packages/vite/src/node/optimizer/esbuildDepPlugin.ts | 6 +++++- 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 packages/playground/optimize-deps/.hidden-dir/foo.js diff --git a/packages/playground/optimize-deps/.hidden-dir/foo.js b/packages/playground/optimize-deps/.hidden-dir/foo.js new file mode 100644 index 00000000000000..e9a8526fe29870 --- /dev/null +++ b/packages/playground/optimize-deps/.hidden-dir/foo.js @@ -0,0 +1 @@ +export const greeting = 'hello!' diff --git a/packages/playground/optimize-deps/__tests__/optimize-deps.spec.ts b/packages/playground/optimize-deps/__tests__/optimize-deps.spec.ts index 33cd73fa18b67c..0a37ffc9df36be 100644 --- a/packages/playground/optimize-deps/__tests__/optimize-deps.spec.ts +++ b/packages/playground/optimize-deps/__tests__/optimize-deps.spec.ts @@ -67,3 +67,7 @@ test('esbuild-plugin', async () => { isBuild ? `Hello from a package` : `Hello from an esbuild plugin` ) }) + +test('import from hidden dir', async () => { + expect(await page.textContent('.hidden-dir')).toBe('hello!') +}) diff --git a/packages/playground/optimize-deps/index.html b/packages/playground/optimize-deps/index.html index 7310ab759f4249..dc0345e6a6f482 100644 --- a/packages/playground/optimize-deps/index.html +++ b/packages/playground/optimize-deps/index.html @@ -43,6 +43,9 @@

Vue & Vuex

Dep with changes from esbuild plugin

This should show a greeting:
+

Dep from hidden dir

+
This should show hello!:
+