jonkemp / gulp-useref

Parse build blocks in HTML files to replace references to non-optimized scripts or stylesheets.
MIT License
705 stars 93 forks source link

Can I use the alternate search path and searchPath at the same time? #226

Open AlexStacker opened 7 years ago

AlexStacker commented 7 years ago

Hi, @jonkemp I want to be able to find the path use alternate search path first and and the option searchPath is not undefined will to be used in next! I change my local modules getPattern.js code:

    if (files[destPath].searchPaths && searchPath) {
        if(searchPath.startsWith('{')){
            searchPaths = path.resolve(cwd, searchPath.replace('{', '{' + files[destPath].searchPaths+','));
        }else{
            searchPaths = path.resolve(cwd, '{'+ files[destPath].searchPaths + ',' + searchPath +'}');
        }
    }else if (files[destPath].searchPaths || searchPath) {
        searchPaths = path.resolve(cwd, files[destPath].searchPaths || searchPath);
    }

It work fine for me.would you like to add the feature to the next version?

fn-xiaobo commented 5 years ago

Can you describe the role of alternate search path more clearly?

AlexStacker commented 5 years ago

It’s been a long time, and I forgot what I was doing at the time. I think it should be close.