We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b10a1ad commit cfa6bbaCopy full SHA for cfa6bba
src/esbuild/external.ts
@@ -1,8 +1,8 @@
1
import { Plugin } from 'esbuild'
2
import { tsconfigPathsToRegExp, match } from 'bundle-require'
3
4
-// Must not start with "/" or "./" or "../"
5
-const NON_NODE_MODULE_RE = /^[^.\/]|^\.[^.\/]|^\.\.[^\/]/
+// Must not start with "/" or "./" or "../" or "C:\" or be the exact strings ".." or "."
+const NON_NODE_MODULE_RE = /^[A-Z]:[\\\/]|^\.{0,2}[\/]|^\.{1,2}$/
6
7
export const externalPlugin = ({
8
external,
@@ -36,7 +36,7 @@ export const externalPlugin = ({
36
return { external: true }
37
}
38
// Exclude any other import that looks like a Node module
39
- if (NON_NODE_MODULE_RE.test(args.path)) {
+ if (!NON_NODE_MODULE_RE.test(args.path)) {
40
return {
41
path: args.path,
42
external: true,
0 commit comments