File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/taro-cli/src/util Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -190,11 +190,14 @@ exports.isAliasPath = function (name, pathAlias = {}) {
190
190
if ( prefixs . length === 0 ) {
191
191
return false
192
192
}
193
- return new RegExp ( `^(${ prefixs . join ( '|' ) } )/` ) . test ( name )
193
+ return prefixs . includes ( name ) || ( new RegExp ( `^(${ prefixs . join ( '|' ) } )/` ) . test ( name ) )
194
194
}
195
195
196
196
exports . replaceAliasPath = function ( filePath , name , pathAlias = { } ) {
197
197
const prefixs = Object . keys ( pathAlias )
198
+ if ( prefixs . includes ( name ) ) {
199
+ return exports . promoteRelativePath ( path . relative ( filePath , pathAlias [ name ] ) )
200
+ }
198
201
const reg = new RegExp ( `^(${ prefixs . join ( '|' ) } )/(.*)` )
199
202
name = name . replace ( reg , function ( m , $1 , $2 ) {
200
203
return exports . promoteRelativePath ( path . relative ( filePath , path . join ( pathAlias [ $1 ] , $2 ) ) )
You can’t perform that action at this time.
0 commit comments