question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BrowserSync with grunt-wiredep not serving files from bower_components folder

See original GitHub issue

Hi everyone!

I tried to connect these two grunt plugins (v. 1.4.28)

wiredep: {
    app: {
        src: ['<%= config.app %>/index.html']
        // ,ignorePath:  /\.\.\//
    },
    sass: {
        src: ['<%= config.app %>/styles/{,*/}*.{scss,sass}']
        // ,ignorePath: /(\.\.\/){1,2}bower_components\//
    }
}

and:

browserSync: {
    dev: {
        bsFiles: {
            src : [
                '.tmp/styles/{,*/}*.css',
                '<%= config.app %>/*.html',
                '<%= config.app %>/scripts/{,*/}*.js',
            ]
        },
        options: {
            browser: 'Chrome',
            watchTask: true,
            server: {
                baseDir: [
                    '<%= config.app %>',
                    '.tmp'
                ],
                routes: {
                    '/bower_components': '../bower_components'
                }
            }
        }
    }
}

but after init grunt:default task i get: Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/bower_components/jquery/dist/jquery.js

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
cachaitocommented, Oct 28, 2014

Hi guys, i can only confirm, that changing a part to:

routes: {
    '/bower_components': './bower_components'
 }

has helped 😃

0reactions
Berg-itcommented, May 17, 2016

Thank you @cachaito you saved my day (Y)

Read more comments on GitHub >

github_iconTop Results From Across the Web

The "wathing files"doesn't work · Issue #1511 · BrowserSync ...
When I move my websites folder to a path that doesn't have () in it, browser-sync works fine. But if I add ()...
Read more >
Gulp + wiredep + browsersync + bower = components not found
I have a build / dist folder structure, with bower_componentes folder at the root of my app folder. Is there a way to...
Read more >
Browsersync options
Serve files from the app directory server: "app" // Serve files from the current ... Note - this is not needed for proxy...
Read more >
NPM browser-sync Package (Install, Use, and Examples)
Browser sync is one of the good tool to avoid manual browser refresh. ... Directory; Step 2: Initialize NPM Project; Step 3: Create...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found