diff --git a/packages/vite-node/src/externalize.ts b/packages/vite-node/src/externalize.ts index e306bbba9a22..0600ed798eb7 100644 --- a/packages/vite-node/src/externalize.ts +++ b/packages/vite-node/src/externalize.ts @@ -61,9 +61,6 @@ async function isValidNodeImport(id: string) { if (extension !== '.js') return false - if (/\.(\w+-)?esm?(-\w+)?\.js$|\/(esm?)\//.test(id)) - return false - id = id.replace('file:///', '') const package_ = await findNearestPackageData(dirname(id)) @@ -71,6 +68,9 @@ async function isValidNodeImport(id: string) { if (package_.type === 'module') return true + if (/\.(\w+-)?esm?(-\w+)?\.js$|\/(esm?)\//.test(id)) + return false + const code = await fsp.readFile(id, 'utf8').catch(() => '') return !ESM_SYNTAX_RE.test(code) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ee182d27ca4..ff7e712a6e48 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2069,6 +2069,12 @@ importers: '@types/inquirer': specifier: ^9.0.3 version: 9.0.3 + '@vitest/test-dep1': + specifier: file:./deps/dep1 + version: file:test/vite-node/deps/dep1 + '@vitest/test-dep2': + specifier: file:./deps/dep2 + version: file:test/vite-node/deps/dep2(@vitest/test-dep1@undefined) execa: specifier: ^6.1.0 version: 6.1.0 @@ -2558,7 +2564,7 @@ packages: resolution: {integrity: sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.6 + '@babel/types': 7.24.0 dev: true /@babel/helper-compilation-targets@7.22.15: @@ -2653,7 +2659,22 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-compilation-targets': 7.22.15 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 + debug: 4.3.4(supports-color@8.1.1) + lodash.debounce: 4.0.8 + resolve: 1.22.8 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-define-polyfill-provider@0.6.1(@babel/core@7.23.3): + resolution: {integrity: sha512-o7SDgTJuvx5vLKD6SFvkydkSMBvahDKGiNJzG22IZYXhiqoe9efY7zocICBgzHV4IRg5wdgl2nEL/tulKIEIbA==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/core': 7.23.3 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-plugin-utils': 7.24.0 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 resolve: 1.22.8 @@ -2712,6 +2733,13 @@ packages: '@babel/types': 7.23.3 dev: false + /@babel/helper-module-imports@7.24.3: + resolution: {integrity: sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.24.0 + dev: true + /@babel/helper-module-transforms@7.23.3(@babel/core@7.12.9): resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} engines: {node: '>=6.9.0'} @@ -2754,6 +2782,11 @@ packages: resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} engines: {node: '>=6.9.0'} + /@babel/helper-plugin-utils@7.24.0: + resolution: {integrity: sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/helper-remap-async-to-generator@7.18.9(@babel/core@7.23.3): resolution: {integrity: sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==} engines: {node: '>=6.9.0'} @@ -2851,7 +2884,7 @@ packages: dependencies: '@babel/helper-function-name': 7.23.0 '@babel/template': 7.22.15 - '@babel/types': 7.23.6 + '@babel/types': 7.24.0 dev: true /@babel/helpers@7.23.2: @@ -2912,7 +2945,7 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.18.9(@babel/core@7.23.3): @@ -2934,7 +2967,7 @@ packages: '@babel/core': ^7.13.0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/plugin-transform-optional-chaining': 7.23.0(@babel/core@7.23.3) dev: true @@ -3175,7 +3208,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.23.3): @@ -3262,7 +3295,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-syntax-import-attributes@7.22.5(@babel/core@7.23.3): @@ -3272,7 +3305,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.23.3): @@ -3281,7 +3314,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.23.3): @@ -3433,7 +3466,7 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.3) - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-arrow-functions@7.18.6(@babel/core@7.23.3): @@ -3453,7 +3486,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-async-generator-functions@7.23.2(@babel/core@7.23.3): @@ -3464,7 +3497,7 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.3) '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.3) dev: true @@ -3490,8 +3523,8 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-module-imports': 7.22.15 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-module-imports': 7.24.3 + '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.3) dev: true @@ -3512,7 +3545,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-block-scoping@7.18.9(@babel/core@7.23.3): @@ -3532,7 +3565,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-class-properties@7.22.5(@babel/core@7.23.3): @@ -3543,7 +3576,7 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.3) - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-class-static-block@7.22.11(@babel/core@7.23.3): @@ -3554,7 +3587,7 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.3) - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.23.3) dev: true @@ -3587,7 +3620,7 @@ packages: '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-function-name': 7.23.0 '@babel/helper-optimise-call-expression': 7.22.5 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.3) '@babel/helper-split-export-declaration': 7.22.6 globals: 11.12.0 @@ -3610,7 +3643,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/template': 7.22.15 dev: true @@ -3631,7 +3664,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-dotall-regex@7.18.6(@babel/core@7.23.3): @@ -3653,7 +3686,7 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.3) - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-duplicate-keys@7.18.9(@babel/core@7.23.3): @@ -3673,7 +3706,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-dynamic-import@7.22.11(@babel/core@7.23.3): @@ -3683,7 +3716,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.3) dev: true @@ -3706,7 +3739,7 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-builder-binary-assignment-operator-visitor': 7.22.15 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-export-namespace-from@7.22.11(@babel/core@7.23.3): @@ -3716,7 +3749,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.3) dev: true @@ -3748,7 +3781,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-function-name@7.18.9(@babel/core@7.23.3): @@ -3772,7 +3805,7 @@ packages: '@babel/core': 7.23.3 '@babel/helper-compilation-targets': 7.22.15 '@babel/helper-function-name': 7.23.0 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-json-strings@7.22.11(@babel/core@7.23.3): @@ -3782,7 +3815,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.3) dev: true @@ -3803,7 +3836,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-logical-assignment-operators@7.22.11(@babel/core@7.23.3): @@ -3813,7 +3846,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.3) dev: true @@ -3834,7 +3867,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-modules-amd@7.18.6(@babel/core@7.23.3): @@ -3857,7 +3890,7 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.3) - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-modules-commonjs@7.23.0(@babel/core@7.23.3): @@ -3895,7 +3928,7 @@ packages: '@babel/core': 7.23.3 '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.3) - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-validator-identifier': 7.22.20 dev: true @@ -3918,7 +3951,7 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.3) - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-named-capturing-groups-regex@7.18.6(@babel/core@7.23.3): @@ -3940,7 +3973,7 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.3) - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-new-target@7.18.6(@babel/core@7.23.3): @@ -3960,7 +3993,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-nullish-coalescing-operator@7.22.11(@babel/core@7.23.3): @@ -3970,7 +4003,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.3) dev: true @@ -3981,7 +4014,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.3) dev: true @@ -3994,7 +4027,7 @@ packages: '@babel/compat-data': 7.23.2 '@babel/core': 7.23.3 '@babel/helper-compilation-targets': 7.22.15 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.3) '@babel/plugin-transform-parameters': 7.22.15(@babel/core@7.23.3) dev: true @@ -4017,7 +4050,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.3) dev: true @@ -4028,7 +4061,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.3) dev: true @@ -4039,7 +4072,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.3) dev: true @@ -4071,7 +4104,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-private-methods@7.22.5(@babel/core@7.23.3): @@ -4082,7 +4115,7 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.3) - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-private-property-in-object@7.22.11(@babel/core@7.23.3): @@ -4094,7 +4127,7 @@ packages: '@babel/core': 7.23.3 '@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.3) - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.23.3) dev: true @@ -4115,7 +4148,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-react-display-name@7.18.6(@babel/core@7.23.3): @@ -4245,7 +4278,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 regenerator-transform: 0.15.2 dev: true @@ -4266,7 +4299,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-shorthand-properties@7.18.6(@babel/core@7.23.3): @@ -4286,7 +4319,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-spread@7.18.9(@babel/core@7.23.3): @@ -4307,7 +4340,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 dev: true @@ -4328,7 +4361,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-template-literals@7.18.9(@babel/core@7.23.3): @@ -4348,7 +4381,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-typeof-symbol@7.18.9(@babel/core@7.23.3): @@ -4368,7 +4401,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-typescript@7.22.15(@babel/core@7.23.3): @@ -4414,7 +4447,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-unicode-property-regex@7.22.5(@babel/core@7.23.3): @@ -4425,7 +4458,7 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.3) - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-unicode-regex@7.18.6(@babel/core@7.23.3): @@ -4447,7 +4480,7 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.3) - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/plugin-transform-unicode-sets-regex@7.22.5(@babel/core@7.23.3): @@ -4458,7 +4491,7 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.3) - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 dev: true /@babel/preset-env@7.18.10(@babel/core@7.23.3): @@ -4556,7 +4589,7 @@ packages: '@babel/compat-data': 7.23.2 '@babel/core': 7.23.3 '@babel/helper-compilation-targets': 7.22.15 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-validator-option': 7.22.15 '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.22.15(@babel/core@7.23.3) '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.22.15(@babel/core@7.23.3) @@ -4628,11 +4661,11 @@ packages: '@babel/plugin-transform-unicode-regex': 7.22.5(@babel/core@7.23.3) '@babel/plugin-transform-unicode-sets-regex': 7.22.5(@babel/core@7.23.3) '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.23.3) - '@babel/types': 7.23.6 - babel-plugin-polyfill-corejs2: 0.4.6(@babel/core@7.23.3) + '@babel/types': 7.24.0 + babel-plugin-polyfill-corejs2: 0.4.10(@babel/core@7.23.3) babel-plugin-polyfill-corejs3: 0.8.5(@babel/core@7.23.3) babel-plugin-polyfill-regenerator: 0.5.3(@babel/core@7.23.3) - core-js-compat: 3.35.1 + core-js-compat: 3.36.1 semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -4669,8 +4702,8 @@ packages: '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 dependencies: '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 - '@babel/types': 7.23.6 + '@babel/helper-plugin-utils': 7.24.0 + '@babel/types': 7.24.0 esutils: 2.0.3 dev: true @@ -4795,6 +4828,15 @@ packages: '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 + /@babel/types@7.24.0: + resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.23.4 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + dev: true + /@base2/pretty-print-object@1.0.1: resolution: {integrity: sha512-4iri8i1AqYHJE2DstZYkyEprg6Pq6sKx3xn5FpySk9sNhH7qN2LLlHJCfDTZRILNwQNPD7mATWM0TBui7uC1pA==} dev: true @@ -5810,7 +5852,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 20.11.27 + '@types/node': 20.11.30 chalk: 4.1.2 jest-message-util: 27.5.1 jest-util: 27.5.1 @@ -5831,7 +5873,7 @@ packages: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.11.27 + '@types/node': 20.11.30 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.8.1 @@ -5868,7 +5910,7 @@ packages: dependencies: '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.11.27 + '@types/node': 20.11.30 jest-mock: 27.5.1 dev: true @@ -5885,7 +5927,7 @@ packages: dependencies: '@jest/types': 27.5.1 '@sinonjs/fake-timers': 8.1.0 - '@types/node': 20.11.27 + '@types/node': 20.11.30 jest-message-util: 27.5.1 jest-mock: 27.5.1 jest-util: 27.5.1 @@ -5914,7 +5956,7 @@ packages: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.11.27 + '@types/node': 20.11.30 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -6045,7 +6087,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.11.27 + '@types/node': 20.11.30 '@types/yargs': 16.0.7 chalk: 4.1.2 dev: true @@ -7081,7 +7123,7 @@ packages: optional: true dependencies: '@babel/core': 7.23.3 - '@babel/helper-module-imports': 7.22.15 + '@babel/helper-module-imports': 7.24.3 '@rollup/pluginutils': 3.1.0(rollup@4.9.6) rollup: 4.9.6 dev: true @@ -9391,7 +9433,7 @@ packages: resolution: {integrity: sha512-N7UDG0/xiPQa2D/XrVJXjkWbpqHCd2sBaB32ggRF2l83RhPfamgKGF8gwwqyksS95qUS5ZYF9aF+lLPRlwI2UA==} dependencies: '@types/connect': 3.4.37 - '@types/node': 20.11.27 + '@types/node': 20.11.30 dev: true /@types/braces@3.0.1: @@ -9412,7 +9454,7 @@ packages: /@types/connect@3.4.37: resolution: {integrity: sha512-zBUSRqkfZ59OcwXon4HVxhx5oWCJmc0OtBTK05M+p0dYjgN6iTwIL2T/WbsQZrEsdnwaF9cWQ+azOnpPvIqY3Q==} dependencies: - '@types/node': 20.11.27 + '@types/node': 20.11.30 dev: true /@types/cookie@0.4.1: @@ -9479,7 +9521,7 @@ packages: /@types/express-serve-static-core@4.17.39: resolution: {integrity: sha512-BiEUfAiGCOllomsRAZOiMFP7LAnrifHpt56pc4Z7l9K6ACyN06Ns1JLMBxwkfLOjJRlSf06NwWsT7yzfpaVpyQ==} dependencies: - '@types/node': 20.11.27 + '@types/node': 20.11.30 '@types/qs': 6.9.9 '@types/range-parser': 1.2.6 '@types/send': 0.17.3 @@ -9540,7 +9582,7 @@ packages: /@types/graceful-fs@4.1.8: resolution: {integrity: sha512-NhRH7YzWq8WiNKVavKPBmtLYZHxNY19Hh+az28O/phfp68CF45pMFud+ZzJ8ewnxnC5smIdF3dqFeiSUQ5I+pw==} dependencies: - '@types/node': 20.11.27 + '@types/node': 20.11.30 dev: true /@types/hast@2.3.4: @@ -9700,7 +9742,7 @@ packages: /@types/node-fetch@2.6.7: resolution: {integrity: sha512-lX17GZVpJ/fuCjguZ5b3TjEbSENxmEk1B2z02yoXSK9WMEWRivhdSY73wWMn6bpcCDAOh6qAdktpKHIlkDk2lg==} dependencies: - '@types/node': 20.11.27 + '@types/node': 20.11.30 form-data: 4.0.0 dev: true @@ -9727,8 +9769,8 @@ packages: undici-types: 5.26.5 dev: true - /@types/node@20.11.27: - resolution: {integrity: sha512-qyUZfMnCg1KEz57r7pzFtSGt49f6RPkPBis3Vo4PbS7roQEDn22hiHzl/Lo1q4i4hDEgBJmBF/NTNg2XR0HbFg==} + /@types/node@20.11.30: + resolution: {integrity: sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==} dependencies: undici-types: 5.26.5 dev: true @@ -9892,7 +9934,7 @@ packages: /@types/resolve@1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 20.11.27 + '@types/node': 20.11.30 dev: true /@types/resolve@1.20.2: @@ -9910,7 +9952,7 @@ packages: resolution: {integrity: sha512-/7fKxvKUoETxjFUsuFlPB9YndePpxxRAOfGC/yJdc9kTjTeP5kRCTzfnE8kPUKCeyiyIZu0YQ76s50hCedI1ug==} dependencies: '@types/mime': 1.3.4 - '@types/node': 20.11.27 + '@types/node': 20.11.30 dev: true /@types/serve-static@1.15.4: @@ -9918,7 +9960,7 @@ packages: dependencies: '@types/http-errors': 2.0.3 '@types/mime': 3.0.3 - '@types/node': 20.11.27 + '@types/node': 20.11.30 dev: true /@types/set-cookie-parser@2.4.2: @@ -12311,7 +12353,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@babel/template': 7.22.15 - '@babel/types': 7.23.6 + '@babel/types': 7.24.0 '@types/babel__core': 7.20.5 '@types/babel__traverse': 7.20.3 dev: true @@ -12350,14 +12392,14 @@ packages: - supports-color dev: true - /babel-plugin-polyfill-corejs2@0.4.6(@babel/core@7.23.3): - resolution: {integrity: sha512-jhHiWVZIlnPbEUKSSNb9YoWcQGdlTLq7z1GHL4AjFxaoOUMuuEVJ+Y4pAaQUGOGk93YsVCKPbqbfw3m0SM6H8Q==} + /babel-plugin-polyfill-corejs2@0.4.10(@babel/core@7.23.3): + resolution: {integrity: sha512-rpIuu//y5OX6jVU+a5BCn1R5RSZYWAl2Nar76iwaOdycqb6JPxediskWFMMl7stfwNJR4b7eiQvh5fB5TEQJTQ==} peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 dependencies: '@babel/compat-data': 7.23.2 '@babel/core': 7.23.3 - '@babel/helper-define-polyfill-provider': 0.4.3(@babel/core@7.23.3) + '@babel/helper-define-polyfill-provider': 0.6.1(@babel/core@7.23.3) semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -12394,7 +12436,7 @@ packages: dependencies: '@babel/core': 7.23.3 '@babel/helper-define-polyfill-provider': 0.4.3(@babel/core@7.23.3) - core-js-compat: 3.35.1 + core-js-compat: 3.36.1 transitivePeerDependencies: - supports-color dev: true @@ -12785,6 +12827,17 @@ packages: update-browserslist-db: 1.0.13(browserslist@4.22.3) dev: true + /browserslist@4.23.0: + resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + dependencies: + caniuse-lite: 1.0.30001600 + electron-to-chromium: 1.4.715 + node-releases: 2.0.14 + update-browserslist-db: 1.0.13(browserslist@4.23.0) + dev: true + /bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} dependencies: @@ -13075,6 +13128,10 @@ packages: resolution: {integrity: sha512-yr2BWR1yLXQ8fMpdS/4ZZXpseBgE7o4g41x3a6AJOqZuOi+iE/WdJYAuZ6Y95i4Ohd2Y+9MzIWRR+uGABH4s3Q==} dev: true + /caniuse-lite@1.0.30001600: + resolution: {integrity: sha512-+2S9/2JFhYmYaDpZvo0lKkfvuKIglrx68MwOBqMGHhQsNkLjB5xtc/TGoEPs+MxjSyN/72qer2g97nzR641mOQ==} + dev: true + /capture-exit@2.0.0: resolution: {integrity: sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==} engines: {node: 6.* || 8.* || >= 10.*} @@ -13252,6 +13309,23 @@ packages: fsevents: 2.3.3 dev: true + /chokidar@3.6.0: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} + engines: {node: '>= 8.10.0'} + requiresBuild: true + dependencies: + anymatch: 3.1.3 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + dev: true + optional: true + /chownr@1.1.4: resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} dev: true @@ -13748,6 +13822,12 @@ packages: browserslist: 4.22.3 dev: true + /core-js-compat@3.36.1: + resolution: {integrity: sha512-Dk997v9ZCt3X/npqzyGdTlq6t7lDBhZwGvV94PKzDArjp7BTRm7WlDAXYd/OWdeFHO8OChQYRJNJvUCqCbrtKA==} + dependencies: + browserslist: 4.23.0 + dev: true + /core-js-pure@3.25.0: resolution: {integrity: sha512-IeHpLwk3uoci37yoI2Laty59+YqH9x5uR65/yiA0ARAJrTrN4YU0rmauLWfvqOuk77SlNJXj2rM6oT/dBD87+A==} requiresBuild: true @@ -14891,6 +14971,10 @@ packages: resolution: {integrity: sha512-AFg4wDHSOk5F+zA8aR+SVIOabu7m0e7BiJnigCvPXzIGy731XENw/lmNxTySpVFtkFEy+eyt4oHhh5FF3NjQNw==} dev: true + /electron-to-chromium@1.4.715: + resolution: {integrity: sha512-XzWNH4ZSa9BwVUQSDorPWAUQ5WGuYz7zJUNpNif40zFCiCl20t8zgylmreNmn26h5kiyw2lg7RfTmeMBsDklqg==} + dev: true + /elliptic@6.5.4: resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} dependencies: @@ -18937,7 +19021,7 @@ packages: '@jest/environment': 27.5.1 '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.11.27 + '@types/node': 20.11.30 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 @@ -19072,7 +19156,7 @@ packages: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.11.27 + '@types/node': 20.11.30 jest-mock: 27.5.1 jest-util: 27.5.1 jsdom: 16.7.0 @@ -19090,7 +19174,7 @@ packages: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.11.27 + '@types/node': 20.11.30 jest-mock: 27.5.1 jest-util: 27.5.1 dev: true @@ -19134,7 +19218,7 @@ packages: dependencies: '@jest/types': 27.5.1 '@types/graceful-fs': 4.1.8 - '@types/node': 20.11.27 + '@types/node': 20.11.30 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -19174,7 +19258,7 @@ packages: '@jest/source-map': 27.5.1 '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.11.27 + '@types/node': 20.11.30 chalk: 4.1.2 co: 4.6.0 expect: 27.5.1 @@ -19254,7 +19338,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 20.11.27 + '@types/node': 20.11.30 dev: true /jest-pnp-resolver@1.2.3(jest-resolve@27.5.1): @@ -19315,7 +19399,7 @@ packages: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.11.27 + '@types/node': 20.11.30 chalk: 4.1.2 emittery: 0.8.1 graceful-fs: 4.2.11 @@ -19380,7 +19464,7 @@ packages: resolution: {integrity: sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: - '@types/node': 20.11.27 + '@types/node': 20.11.30 graceful-fs: 4.2.11 dev: true @@ -19392,7 +19476,7 @@ packages: '@babel/generator': 7.23.3 '@babel/plugin-syntax-typescript': 7.23.3(@babel/core@7.23.3) '@babel/traverse': 7.23.3 - '@babel/types': 7.23.6 + '@babel/types': 7.24.0 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 '@types/babel__traverse': 7.20.3 @@ -19431,7 +19515,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 20.11.27 + '@types/node': 20.11.30 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -19468,7 +19552,7 @@ packages: dependencies: '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.11.27 + '@types/node': 20.11.30 ansi-escapes: 4.3.2 chalk: 4.1.2 jest-util: 27.5.1 @@ -26290,6 +26374,17 @@ packages: picocolors: 1.0.0 dev: true + /update-browserslist-db@1.0.13(browserslist@4.23.0): + resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.23.0 + escalade: 3.1.1 + picocolors: 1.0.0 + dev: true + /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: @@ -26943,7 +27038,7 @@ packages: graceful-fs: 4.2.11 neo-async: 2.6.2 optionalDependencies: - chokidar: 3.5.3 + chokidar: 3.6.0 watchpack-chokidar2: 2.0.1 transitivePeerDependencies: - supports-color @@ -27301,7 +27396,7 @@ packages: '@webassemblyjs/wasm-parser': 1.11.6 acorn: 8.11.3 acorn-import-assertions: 1.9.0(acorn@8.11.3) - browserslist: 4.22.3 + browserslist: 4.23.0 chrome-trace-event: 1.0.3 enhanced-resolve: 5.15.0 es-module-lexer: 1.3.1 @@ -27591,7 +27686,6 @@ packages: /workbox-google-analytics@7.0.0: resolution: {integrity: sha512-MEYM1JTn/qiC3DbpvP2BVhyIH+dV/5BjHk756u9VbwuAhu0QHyKscTnisQuz21lfRpOwiS9z4XdqeVAKol0bzg==} - deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained dependencies: workbox-background-sync: 7.0.0 workbox-core: 7.0.0 @@ -27987,3 +28081,18 @@ packages: resolution: {directory: test/optimize-deps/dep-url, type: directory} name: '@vitest/test-deps-url' dev: true + + file:test/vite-node/deps/dep1: + resolution: {directory: test/vite-node/deps/dep1, type: directory} + name: '@vitest/test-dep1' + dev: true + + file:test/vite-node/deps/dep2(@vitest/test-dep1@undefined): + resolution: {directory: test/vite-node/deps/dep2, type: directory} + id: file:test/vite-node/deps/dep2 + name: '@vitest/test-dep2' + peerDependencies: + '@vitest/test-dep1': '*' + dependencies: + '@vitest/test-dep1': file:test/vite-node/deps/dep1 + dev: true diff --git a/test/vite-node/deps/dep1/esm/index.js b/test/vite-node/deps/dep1/esm/index.js new file mode 100644 index 000000000000..664e0bad5443 --- /dev/null +++ b/test/vite-node/deps/dep1/esm/index.js @@ -0,0 +1,4 @@ +// esm/index.js was detected as isValidNodeImport(id) = false +// event if package.json has type = module, +// which causes dual package hazard when other external esm import esm/index.js. +export const data = {} diff --git a/test/vite-node/deps/dep1/package.json b/test/vite-node/deps/dep1/package.json new file mode 100644 index 000000000000..a438d0768ddd --- /dev/null +++ b/test/vite-node/deps/dep1/package.json @@ -0,0 +1,5 @@ +{ + "name": "@vitest/test-dep1", + "type": "module", + "exports": "./esm/index.js" +} diff --git a/test/vite-node/deps/dep2/index.js b/test/vite-node/deps/dep2/index.js new file mode 100644 index 000000000000..23d22007ced1 --- /dev/null +++ b/test/vite-node/deps/dep2/index.js @@ -0,0 +1 @@ +export { data } from '@vitest/test-dep1' diff --git a/test/vite-node/deps/dep2/package.json b/test/vite-node/deps/dep2/package.json new file mode 100644 index 000000000000..81049572392f --- /dev/null +++ b/test/vite-node/deps/dep2/package.json @@ -0,0 +1,8 @@ +{ + "name": "@vitest/test-dep2", + "type": "module", + "exports": "./index.js", + "peerDependencies": { + "@vitest/test-dep1": "*" + } +} diff --git a/test/vite-node/package.json b/test/vite-node/package.json index 6bb382c179f7..c655543de30a 100644 --- a/test/vite-node/package.json +++ b/test/vite-node/package.json @@ -11,6 +11,8 @@ }, "devDependencies": { "@types/inquirer": "^9.0.3", + "@vitest/test-dep1": "file:./deps/dep1", + "@vitest/test-dep2": "file:./deps/dep2", "execa": "^6.1.0", "inquirer": "^9.2.7", "vite-node": "workspace:*", diff --git a/test/vite-node/test/external.test.ts b/test/vite-node/test/external.test.ts new file mode 100644 index 000000000000..f751e594d877 --- /dev/null +++ b/test/vite-node/test/external.test.ts @@ -0,0 +1,12 @@ +import { expect, test } from 'vitest' + +// @ts-expect-error no ts +import * as dep1 from '@vitest/test-dep1' + +// @ts-expect-error no ts +import * as dep2 from '@vitest/test-dep2' + +test('no dual package hazard by externalizing esm deps by default', async () => { + dep1.data.hello = 'world' + expect(dep2.data.hello).toBe('world') +})