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.

basedir doesn't like relative paths up the tree?

See original GitHub issue

For example, when I use ./app as my baseDir:

gulp.task('browser-sync', function() {
    browserSync.init(["app/*.css", "app/js/*.js"], {
        server: {
            baseDir: "./app"
        },
    });
});

I can’t reference directories up the tree, resulting in a 404. Is there a workaround? <script src="../bower_components/angular-route/angular-route.min.js"></script>

I mean, I get that it’s not a natural server behavior to up the tree, so maybe I should just move the bower_components into the /app directory and shut up. 😃

Issue Analytics

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

github_iconTop GitHub Comments

11reactions
RichardsonWTRcommented, Jun 8, 2016

I know this post is old, but I made it with this configuration:

gulp.task('browserSync',function(){
    browserSync.init({
        startPath:'./app',
        server:{
            baseDir: './'
        }
    })
});

baseDir has my node_modules folder and app folder has my index.html file.

In my index.html file the script tag looks like this: <script src='../node_modules/<path_to_file>'></script>

6reactions
shakyShanecommented, Nov 17, 2014

For anyone that lands on this thread - you can now do this by using the routes option on the server.

browserSync({
    server: {
        baseDir: "./app",
        routes: {
             "bower_components": "./bower_components"
        }
    }
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Why am I receiving an error when trying to create the ...
I am receiving the error "A file path that is implicitly relative to the current working directory is not allowed in the database...
Read more >
"find" output relative to directory - Unix & Linux Stack Exchange
I'd like to use find to list all files and directories recursively in a given root for a cpio operation. However, I don't...
Read more >
pathlib — Object-oriented filesystem paths — Python 3.11.1 ...
Represent the path as a file URI. ValueError is raised if the path isn't absolute. Return whether or not this path is relative...
Read more >
Documentation - Module Resolution - TypeScript
For non-relative module imports, however, the compiler walks up the directory tree starting with the directory containing the importing file, trying to locate ......
Read more >
Path Operations - Essential Java Classes - Oracle Help Center
You can think of the Path as storing these name elements as a sequence. ... note that normalize doesn't check at the file...
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