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.

Option to Use Relative Path Rather Than Absolute

See original GitHub issue

I haven’t been able to find a way to use gulp inject to inject paths relative to the html file.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
pgiladcommented, Apr 18, 2014

try changing the following line:

//..
 .pipe(
            inject(

            // path.js.compile is an array of file paths
                gulp.src(path.js.compile, {read:false})
            )
        )

To:

 .pipe(
            inject(gulp.src(path.js.compile, {read:false}), {
               ignorePath: '/Users/walterroman/Sites/minesweeper-angular',
               addRootSlash: false
            })
        )

That should probably fix it. BTW - I think you are using absolute paths in your path.js.compile. You will probably do better with using relative file paths there, and therefore need to ignore a smaller path.

For me: I usually output everything to build/ so that I use the option `ignorePath: ‘build/’

0reactions
pgiladcommented, Sep 11, 2014

👀 Flashback!! 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Absolute vs Relative Path - Which Should You Be Using?
"Using absolute links for images allows you to assert ownership in the image search results, which reduces the likelihood of duplicate content ...
Read more >
What are the differences between absolute and relative paths?
An absolute path makes no assumptions about your current location in relation to the location of the file or directory it's describing. An ......
Read more >
Absolute vs. Relative Paths/Links - CoffeeCup Software
The first difference you'll notice between the two different types of links is that absolute paths always include the domain name of the...
Read more >
Should I Use Relative or Absolute URLs? - SEOquake
The main difference between absolute and relative paths is that absolute URLs always include the domain name of the site with http://www.
Read more >
Can I use relative paths instead of absolute paths? – nTopology
If both files are to be stored in the same directory, then the entire Path input is not needed. For example, the [File_Name].[Extension]...
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