File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
packages/taro-vite-runner/src/harmony Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ export default function (viteCompilerContext: ViteHarmonyCompilerContext): Plugi
108108 let importPath = value [ 0 ]
109109 const ext = path . extname ( importPath )
110110 const basename = path . basename ( importPath , ext )
111- if ( importPath . startsWith ( '/' ) ) {
111+ if ( path . isAbsolute ( importPath ) ) {
112112 importPath = path . relative ( path . dirname ( rawId ) , importPath )
113113 }
114114 ncObj [ key ] = [ path . join ( path . dirname ( importPath ) , basename ) , value [ 1 ] ]
@@ -165,7 +165,7 @@ export default function (viteCompilerContext: ViteHarmonyCompilerContext): Plugi
165165 let importPath = value [ 0 ]
166166 const ext = path . extname ( importPath )
167167 const basename = path . basename ( importPath , ext )
168- if ( importPath . startsWith ( '/' ) ) {
168+ if ( path . isAbsolute ( importPath ) ) {
169169 importPath = path . relative ( path . dirname ( rawId ) , importPath )
170170 }
171171 ncObj [ key ] = [ path . join ( path . dirname ( importPath ) , basename ) , value [ 1 ] ]
You can’t perform that action at this time.
0 commit comments