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

Looking for assets in '/' #193

Closed michaeljoelphillips closed 6 years ago

michaeljoelphillips commented 8 years ago

Greetings,

I'm trying to move a gulp build location to the root directory of a project. I've moved the gulp scripts, *.rc files, and the assets to the root directory and I've modified all my configuration files to reflect the changes to the paths.

When I run gulp build I receive the following error:

[20:07:19] Using gulpfile /srv/gulpfile.js
[20:07:19] Starting 'clean'...
[20:07:20] Finished 'clean' after 85 ms
[20:07:20] Starting 'build'...
[20:07:20] Starting 'css'...
[20:07:20] Starting 'partials'...
[20:07:20] Starting 'fonts'...
[20:07:20] Starting 'images'...
[20:07:20] Starting 'misc'...
[20:07:20] Finished 'build' after 740 ms
[20:07:20] Finished 'misc' after 168 ms
[20:07:21] Finished 'partials' after 780 ms
[20:07:21] Finished 'images' after 495 ms
[20:07:21] Finished 'fonts' after 674 ms
[20:07:22] Finished 'css' after 2.3 s
[20:07:22] Starting 'inject'...
[20:07:22] gulp-inject 1 files into app.html.twig.
[20:07:22] gulp-inject 97 files into app.html.twig.
[20:07:22] Finished 'inject' after 383 ms
[20:07:22] Starting 'html'...
[20:07:23] gulp-inject 1 files into app.html.twig.
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: Error: File not found with singular glob: /bower_components/angular-chart.js/dist/angular-chart.css
    at DestroyableTransform.<anonymous> (/srv/node_modules/gulp-useref/lib/streamManager.js:90:36)
    at emitOne (events.js:82:20)
    at DestroyableTransform.emit (events.js:169:7)
    at emitOne (events.js:82:20)
    at Through2.emit (events.js:169:7)
    at OrderedStreams.<anonymous> (/srv/node_modules/gulp-useref/node_modules/vinyl-fs/node_modules/glob-stream/index.js:138:20)
    at emitOne (events.js:77:13)
    at OrderedStreams.emit (events.js:169:7)
    at emitOne (events.js:77:13)
    at DestroyableTransform.emit (events.js:169:7)

For some reason, useref is attempting to access my assets folder from /bower_components instead of bower_components. I've gone as far to give a fully qualified path to the assets wherever the gulp build references the bower_components folder, but it doesn't seem to change the outcome. I can pass in the noAssets option and the build will finish without errors, but when I give it searchPath: './' or searchPath: '' the outcome is the same. Where does useref get the paths for the assets folder?

Thanks in advanced!

jonkemp commented 8 years ago

This looks like a bug report. In order to be as helpful as possible, here are some guidelines for bug reports:

  1. Use the GitHub issue search — check if the issue has already been reported.
  2. Check if the issue has been fixed — try to reproduce it using the latest master or development branch in the repository.
  3. Isolate the problem — create a reduced test case and a live example.

A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s) and OS experience the problem? What would you expect to be the outcome? All these details will help people to fix any potential bugs. Thanks!

gen4sp commented 8 years ago

any success?