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.

Treat all unknown extensions as resources

See original GitHub issue

I’m getting a bit tired of extending our whitelist like in #665. I think we should have a “catch all” loader that uses file-loader for any unknown extensions.

This makes sense because it’s easy to explain: “if you import something that isn’t JS or CSS, it becomes a part of the build, you get its filename, and can do whatever with it”.

I think @dralletje planned to look into this.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:23
  • Comments:22 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
cesarandreucommented, Sep 18, 2016

Looking at webpack.config.dev.js, I’m wondering: why use url-loader for audio / video, but file-loader for images? In the scenarios I’m most familiar with, you’d usually do the complete opposite of that: you want essential images, like sprite sheets, to load immediately, but sound and video can wait.

I think this using file-loader for unknown resources is a good default.

0reactions
cpojercommented, Dec 5, 2016

Thanks Dan for sharing my messages to you. Yes, the transform field is meant to be used for this. If you guys are building css-jest and scss-jest and all, I’m happy to support this officially in Jest – this was my long term plan so we can also have style information in JS, just like we do in react-native:

<View
  style={{
    color: 'green',
  }}
/>

etc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make VS Code treat a file extensions as a certain ...
Go to VS_CODE_FOLDER/resources/app/extensions/ and there update package.json ... You can add the md.html extension to your settings.json file associations ...
Read more >
8 Ways To Identify Unknown File Types - MakeUseOf
Google knows everything. I think it does know about all file types too as it sources the details from a few sites we...
Read more >
Error of Unknown file extension ".svelte" in SvelteKit #375
I tried and it works great. It seems that the temporary solution is to add these fields to all components installed inside @smui...
Read more >
How To Open File With UNKNOWN Extension?
If the systems has insufficient resources to open UNKNOWN files, try closing all currently running applications and try again. 5. Ensure that ...
Read more >
Visual Studio Code Workspace Trust security
The Workspace Trust feature lets you decide whether code in your project folder can be executed by VS Code and extensions without your...
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