diff --git a/packages/vite-node/src/externalize.ts b/packages/vite-node/src/externalize.ts index 709424f19b02..808508b5a2be 100644 --- a/packages/vite-node/src/externalize.ts +++ b/packages/vite-node/src/externalize.ts @@ -65,6 +65,7 @@ async function _shouldExternalize( ): Promise { if (isNodeBuiltin(id)) return id + // data: should be processed by native import, // since it is a feature of ESM if (id.startsWith('data:')) diff --git a/test/vite-node/src/watched.js b/test/vite-node/src/watch/index.cjs similarity index 100% rename from test/vite-node/src/watched.js rename to test/vite-node/src/watch/index.cjs diff --git a/test/vite-node/src/watch/index.js b/test/vite-node/src/watch/index.js new file mode 100644 index 000000000000..54046b60bfa1 --- /dev/null +++ b/test/vite-node/src/watch/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line no-console +console.log('test 1') diff --git a/test/vite-node/src/watch/index.mjs b/test/vite-node/src/watch/index.mjs new file mode 100644 index 000000000000..54046b60bfa1 --- /dev/null +++ b/test/vite-node/src/watch/index.mjs @@ -0,0 +1,2 @@ +// eslint-disable-next-line no-console +console.log('test 1') diff --git a/test/vite-node/test/cli.test.ts b/test/vite-node/test/cli.test.ts index 84ac212cf277..893d4bb80d11 100644 --- a/test/vite-node/test/cli.test.ts +++ b/test/vite-node/test/cli.test.ts @@ -45,6 +45,4 @@ it.each(['index.js', 'index.cjs', 'index.mjs'])('correctly runs --watch %s', asy await cli.waitForStdout('test 1') editFile(entryPath, c => c.replace('test 1', 'test 2')) await cli.waitForStdout('test 2') -}, { - timeout: 10_000, })