File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5858 var distMatch = selfSrc . match ( / ^ ( .* ?) \/ ? (?: c l a s s i c \/ ) ? i n c l u d e - c l a s s i c \. j s (?: [ ? # ] | $ ) / ) ;
5959 if ( distMatch && distMatch [ 1 ] ) {
6060 disturl = distMatch [ 1 ] ;
61- //web 与 dist 同级:libsurl 若是相对路径的 web/libs,随 disturl 一起校正
61+ //相对路径的 web/libs 先去掉一层 ../,再接到 disturl 后面
6262 if ( libsurl && ! / ^ h t t p s ? : \/ \/ / i. test ( libsurl ) && / (?: ^ | \/ ) w e b \/ l i b s \/ ? $ / . test ( libsurl ) ) {
63- libsurl = disturl . replace ( / \/ ? d i s t \/ ? $ / , '' ) + '/web/libs' ;
63+ libsurl = disturl + '/' + libsurl . replace ( / ^ \. \. \/ / , '' ) ;
6464 }
6565 }
6666 var includes = ( targetScript . getAttribute ( 'include' ) || "" ) . split ( "," ) ;
Original file line number Diff line number Diff line change 5858 var distMatch = selfSrc . match ( / ^ ( .* ?) \/ ? (?: l e a f l e t \/ ) ? i n c l u d e - l e a f l e t \. j s (?: [ ? # ] | $ ) / ) ;
5959 if ( distMatch && distMatch [ 1 ] ) {
6060 disturl = distMatch [ 1 ] ;
61- //web 与 dist 同级:libsurl 若是相对路径的 web/libs,随 disturl 一起校正
61+ //相对路径的 web/libs 先去掉一层 ../,再接到 disturl 后面
6262 if ( libsurl && ! / ^ h t t p s ? : \/ \/ / i. test ( libsurl ) && / (?: ^ | \/ ) w e b \/ l i b s \/ ? $ / . test ( libsurl ) ) {
63- libsurl = disturl . replace ( / \/ ? d i s t \/ ? $ / , '' ) + '/web/libs' ;
63+ libsurl = disturl + '/' + libsurl . replace ( / ^ \. \. \/ / , '' ) ;
6464 }
6565 }
6666 var includes = ( targetScript . getAttribute ( 'include' ) || '' ) . split ( ',' ) ;
Original file line number Diff line number Diff line change 5858 var distMatch = selfSrc . match ( / ^ ( .* ?) \/ ? (?: m a p b o x g l \/ ) ? i n c l u d e - m a p b o x g l \. j s (?: [ ? # ] | $ ) / ) ;
5959 if ( distMatch && distMatch [ 1 ] ) {
6060 disturl = distMatch [ 1 ] ;
61- //web 与 dist 同级:libsurl 若是相对路径的 web/libs,随 disturl 一起校正
61+ //相对路径的 web/libs 先去掉一层 ../,再接到 disturl 后面
6262 if ( libsurl && ! / ^ h t t p s ? : \/ \/ / i. test ( libsurl ) && / (?: ^ | \/ ) w e b \/ l i b s \/ ? $ / . test ( libsurl ) ) {
63- libsurl = disturl . replace ( / \/ ? d i s t \/ ? $ / , '' ) + '/web/libs' ;
63+ libsurl = disturl + '/' + libsurl . replace ( / ^ \. \. \/ / , '' ) ;
6464 }
6565 }
6666 var includes = ( targetScript . getAttribute ( 'include' ) || '' ) . split ( ',' ) ;
Original file line number Diff line number Diff line change 5858 var distMatch = selfSrc . match ( / ^ ( .* ?) \/ ? (?: m a p l i b r e g l \/ ) ? i n c l u d e - m a p l i b r e g l \. j s (?: [ ? # ] | $ ) / ) ;
5959 if ( distMatch && distMatch [ 1 ] ) {
6060 disturl = distMatch [ 1 ] ;
61- //web 与 dist 同级:libsurl 若是相对路径的 web/libs,随 disturl 一起校正
61+ //相对路径的 web/libs 先去掉一层 ../,再接到 disturl 后面
6262 if ( libsurl && ! / ^ h t t p s ? : \/ \/ / i. test ( libsurl ) && / (?: ^ | \/ ) w e b \/ l i b s \/ ? $ / . test ( libsurl ) ) {
63- libsurl = disturl . replace ( / \/ ? d i s t \/ ? $ / , '' ) + '/web/libs' ;
63+ libsurl = disturl + '/' + libsurl . replace ( / ^ \. \. \/ / , '' ) ;
6464 }
6565 }
6666 var includes = ( targetScript . getAttribute ( 'include' ) || '' ) . split ( ',' ) ;
Original file line number Diff line number Diff line change 5858 var distMatch = selfSrc . match ( / ^ ( .* ?) \/ ? (?: o l \/ ) ? i n c l u d e - o l \. j s (?: [ ? # ] | $ ) / ) ;
5959 if ( distMatch && distMatch [ 1 ] ) {
6060 disturl = distMatch [ 1 ] ;
61- //web 与 dist 同级:libsurl 若是相对路径的 web/libs,随 disturl 一起校正
61+ //相对路径的 web/libs 先去掉一层 ../,再接到 disturl 后面
6262 if ( libsurl && ! / ^ h t t p s ? : \/ \/ / i. test ( libsurl ) && / (?: ^ | \/ ) w e b \/ l i b s \/ ? $ / . test ( libsurl ) ) {
63- libsurl = disturl . replace ( / \/ ? d i s t \/ ? $ / , '' ) + '/web/libs' ;
63+ libsurl = disturl + '/' + libsurl . replace ( / ^ \. \. \/ / , '' ) ;
6464 }
6565 }
6666 var includes = ( targetScript . getAttribute ( 'include' ) || '' ) . split ( ',' ) ;
Original file line number Diff line number Diff line change 5858 var distMatch = selfSrc . match ( / ^ ( .* ?) \/ ? (?: o p e n l a y e r s \/ ) ? i n c l u d e - o p e n l a y e r s \. j s (?: [ ? # ] | $ ) / ) ;
5959 if ( distMatch && distMatch [ 1 ] ) {
6060 disturl = distMatch [ 1 ] ;
61- //web 与 dist 同级:libsurl 若是相对路径的 web/libs,随 disturl 一起校正
61+ //相对路径的 web/libs 先去掉一层 ../,再接到 disturl 后面
6262 if ( libsurl && ! / ^ h t t p s ? : \/ \/ / i. test ( libsurl ) && / (?: ^ | \/ ) w e b \/ l i b s \/ ? $ / . test ( libsurl ) ) {
63- libsurl = disturl . replace ( / \/ ? d i s t \/ ? $ / , '' ) + '/web/libs' ;
63+ libsurl = disturl + '/' + libsurl . replace ( / ^ \. \. \/ / , '' ) ;
6464 }
6565 }
6666 var includes = ( targetScript . getAttribute ( 'include' ) || '' ) . split ( ',' ) ;
Original file line number Diff line number Diff line change 7070 //加载类库资源文件
7171 function load ( config ) {
7272 var libsurl = config . libsurl ;
73- //web 在 examples 上一级:libsurl 若是相对路径的 web/libs,按 basePath 校正
73+ //相对路径的 web/libs 先去掉一层 ../,再按 basePath 拼接。
74+ //默认 libsurl 按 examples/<产品>/ 的深度写(../../web/libs),en 页面更深一层,basePath 会多退一级
7475 if ( libsurl && ! / ^ h t t p s ? : \/ \/ / i. test ( libsurl ) && / (?: ^ | \/ ) w e b \/ l i b s \/ ? $ / . test ( libsurl ) ) {
75- libsurl = basePath . replace ( / \/ ? $ / , '/../' ) + 'web/libs' ;
76+ libsurl = basePath + libsurl . replace ( / ^ \. \. \/ / , '' ) ;
7677 }
7778
7879 var includes = ( targetScript . getAttribute ( 'include' ) || "" ) . split ( "," ) ;
You can’t perform that action at this time.
0 commit comments