Gulp throwing error: File not found with singular

2019-04-18 23:09发布

问题:

After renaming my file I am getting the following error when running the gulp build task:

Error: Error: File not found with singular glob: F:\Projects\xyz\HTML\app\css\main.css
    at DestroyableTransform.<anonymous> (F:\Projects\xyz\HTML\node_modules\gulp-useref\lib\streamManager.js:90:36)

main.css file no longer exists as I changed it to style.css but for some reason it is searching for the old file.

回答1:

As it turns out I missed changing file name in HTML file as it was calling main.css instead of style.css.

    <!--build:css css/main.min.css -->
    <link rel="stylesheet" href="css/main.css">
    <!-- endbuild -->

Changed it to:

    <!--build:css css/style.min.css -->
    <link rel="stylesheet" href="css/style.css">
    <!-- endbuild -->

An honest mistake but I believe someone else can run into something similar :)