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.

Default files break sourcemaps and other relative imports (images, fonts, etc)

See original GitHub issue

We had this problem with /g/ before but I didn’t realize it now affects all short single file links too. There are several ways to fix this (with various difficulty and success rate) but I don’t think it is worth the effort right now. Until we can make this work without creating possible problems, we should recommend using full URLs everywhere (it still makes sense to set default file in package.json as we can use it to highlight the correct link on our website).

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
MartinKolarikcommented, Aug 26, 2018

Admittedly, today I would probably agree that it makes more sense to have them optimized for development and serve a non-minified file with a redirect because you are more likely to type the URL by hand in quick demos and can copy-paste the full URL for more serious use cases but it is not something we should change now when people rely on the current behavior.

0reactions
MartinKolarikcommented, Aug 26, 2018

Oh you meant redirecting the short URL. Yes that would fix the problem for single-file links but would be suboptimal for production usage because of the added redirect.

You could argue that the short links should only be used during development, in which case the redirect would be fine but we decided to optimize them for production (which is also why they are minified).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack [url/file-loader] is not resolving the Relative Path ...
Now, if I am trying to import Project-A index.scss in Project-B index.scss as another partial [Commenting out the Background Image URL Depency], ...
Read more >
clean-css
sourceMap - exposes source map under sourceMap property, e.g. new CleanCSS().minify(source).sourceMap (default is false) If input styles are a product of CSS ...
Read more >
rollup.js
rollup.config.js import fetch from 'node-fetch'; export default fetch('/some-remote-service-or-file-which-returns-actual-config');.
Read more >
Asset Management
Now let's try to incorporate some other assets, like images, ... In order to import a CSS file from within a JavaScript module, ......
Read more >
Overview of the sass R package
Resolving relative imports. Another problem that sass_layer() helps solve is that sometimes your Sass code might want to import a local 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