@@ -7,6 +7,7 @@ var _createClass = function () { function defineProperties(target, props) { for
7
7
function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
8
8
9
9
var webpack = require ( 'webpack' ) ;
10
+ var requireg = require ( 'requireg' ) ;
10
11
11
12
var Config = require ( './Config.js' ) ,
12
13
Manager = require ( '../modules/manager.js' ) ,
@@ -78,7 +79,22 @@ var Project = function () {
78
79
if ( this . extendConfig != 'config' ) {
79
80
var _ret = function ( ) {
80
81
var moduleName = 'ykit-config-' + _this . extendConfig ,
81
- modulePath = sysPath . join ( _this . cwd , 'node_modules' , moduleName ) ;
82
+ modulePath = '' ;
83
+
84
+ var localSearchPath = sysPath . join ( _this . cwd , 'node_modules/' , moduleName ) ;
85
+ var localSearchPathQnpm = sysPath . join ( _this . cwd , 'node_modules/' , '@qnpm/' + moduleName ) ;
86
+
87
+ if ( requireg . resolve ( moduleName ) ) {
88
+ modulePath = requireg . resolve ( moduleName ) ;
89
+ } else if ( requireg . resolve ( localSearchPath ) ) {
90
+ modulePath = localSearchPath ;
91
+ } else if ( requireg . resolve ( '@qnpm/' + moduleName ) ) {
92
+ modulePath = requireg . resolve ( '@qnpm/' + moduleName ) ;
93
+ moduleName = '@qnpm/' + moduleName ;
94
+ } else if ( requireg . resolve ( localSearchPathQnpm ) ) {
95
+ modulePath = localSearchPathQnpm ;
96
+ moduleName = '@qnpm/' + moduleName ;
97
+ }
82
98
83
99
extend ( true , userConfig . eslintConfig , Manager . loadEslintConfig ( modulePath ) ) ;
84
100
extend ( true , userConfig . stylelintConfig , Manager . loadStylelintConfig ( modulePath ) ) ;
0 commit comments