@@ -6,6 +6,7 @@ import commonjs from '@rollup/plugin-commonjs'
66import json from '@rollup/plugin-json'
77import replace from '@rollup/plugin-replace'
88import { nodeResolve } from '@rollup/plugin-node-resolve'
9+ import { isRelative } from '@socketsecurity/registry/lib/path'
910import { escapeRegExp } from '@socketsecurity/registry/lib/regexps'
1011import rangesIntersect from 'semver/ranges/intersects.js'
1112import { readPackageUpSync } from 'read-package-up'
@@ -89,6 +90,9 @@ export default (extendConfig = {}) => {
8990 return true
9091 }
9192 const id = normalizeId ( id_ )
93+ if ( isRelative ( id ) ) {
94+ return false
95+ }
9296 if ( id . endsWith ( '.cjs' ) ) {
9397 return true
9498 }
@@ -100,10 +104,10 @@ export default (extendConfig = {}) => {
100104 if ( resolvedId . endsWith ( '.json' ) ) {
101105 return isAncestorsCjs ( resolvedId , parentId )
102106 }
103- if ( ! isPackageName ( id ) ) {
107+ const name = getPackageName ( id )
108+ if ( ! isPackageName ( name ) || name === '@babel/runtime' ) {
104109 return false
105110 }
106- const name = getPackageName ( id )
107111 if ( isEsmId ( resolvedId , parentId ) ) {
108112 const parentPkg = parentId
109113 ? readPackageUpSync ( { cwd : path . dirname ( parentId ) } ) ?. packageJson
@@ -126,7 +130,8 @@ export default (extendConfig = {}) => {
126130 if ( isAncestorsCjs ( resolvedId , parentId ) ) {
127131 return true
128132 }
129- const parentNameStart = parentNodeModulesIndex + 14
133+ const parentNameStart =
134+ parentNodeModulesIndex + SLASH_NODE_MODULES_SLASH . length
130135 const parentNameEnd = getPackageNameEnd ( parentId , parentNameStart )
131136 const {
132137 version,
0 commit comments