Default files break sourcemaps and other relative imports (images, fonts, etc)
See original GitHub issueWe 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:
- Created 6 years ago
- Comments:8 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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).