You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . getUserLibDir = getUserLibDir ;
function _react ( ) {
const data = _interopRequireDefault ( require ( "react" ) ) ;
_react = function _react ( ) {
return data ;
} ;
return data ;
}
function _umi ( ) {
const data = require ( "umi" ) ;
_umi = function _umi ( ) {
return data ;
} ;
return data ;
}
function _path ( ) {
const data = require ( "path" ) ;
_path = function _path ( ) {
return data ;
} ;
return data ;
}
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function getUserLibDir ( {
library ,
pkg ,
cwd
} ) {
if ( pkg . dependencies && pkg . dependencies [ library ] || pkg . devDependencies && pkg . devDependencies [ library ] ) {
return _umi ( ) . utils . winPath ( ( 0 , _path ( ) . dirname ) ( // 通过 resolve 往上找,可支持 lerna 仓库
// lerna 仓库如果用 yarn workspace 的依赖不一定在 node_modules, 可能被提到根目录, 并且没有 link
_umi ( ) . utils . resolve . sync ( ` ${ library } /package.json ` , {
basedir : cwd
} ) ) ) ;
}
return null ;
}