-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use node's resolve system #8
Comments
It should behave the same as the webpack loader. I'm experiencing the same bug. |
A way to reproduce issue would be nice |
Please modify |
@nickpalmer please tell me your commit is found somewhere on npm 👯♀️ @sheerun please consider his commit. thanks. |
If you import an SVG from import alarm from 'boxicons/svg/regular/bx-alarm.svg';
export default function Hello(props) {
return (
<div>
<img src={alarm} />
</div>
);
} You will get an error like this. SyntaxError: [file name]: File does not exist This is because the plugin will look for the file in Conventionally, if someone were intending to use an SVG from their project they should use This is why this commit submitted by @nickpalmer would work. I looked around for other alternatives and your package is probably the best one to date with the exception for this small quirk. Do let me know if you need further clarifications or if you would like me to submit a working PR. |
@cblanquera hello! im assuming youre using this babel plugin to server side render the assets created from Webpack's file-loader if im wrong, no need to answer but if yes, what version of Webpack and file loader are u running? ideally Wp5 and latest version of file loader is what im looking for unfortunately, I get the feeling that this package isnt maintained anymore |
It seemed unintuitive that an
import
would have to point to a relative path and isn't processed by node's module loading system (i.e. checknode_modules
, etc). Perhaps that because I was expecting the same behavior as webpacks file-loader.In any case, is that something that can be added?
The text was updated successfully, but these errors were encountered: