-
Notifications
You must be signed in to change notification settings - Fork 150
fix: load asset content #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: load asset content #62
Conversation
cwillisf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with these changes but I'm confused about the need since there's no mention of file-loader in webpack.config.js. In the interest of my own learning: is file-loader somehow included in the default Webpack config, and if so is that documented somewhere? (I can't seem to find it...)
|
@cwillisf that's a good question. I believe the rule for loading SVGs with |
|
@ktbee aha! That makes sense. Thanks! |
|
Also here is the relevant Webpack documentation, for anyone that's not familiar with the |
kchadha
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ktbee thanks for linking to the documentation. LGTM!
|
🎉 This PR is included in version 1.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Resolves
When I tried to use the default SVG asset in scratch-storage's
builtinsfolder, I found that thedataproperty just returned a string that was the file's path and name. This prevented me from getting the file's contents.Proposed Changes
Disable the Webpack
file-loaderloader for theserequirestatements. Webpack will still use the specifiedarraybuffer-loaderloader for these files, but not usingfile-loaderwill givearraybuffer-loaderthe contents of the files rather than a string with the path and name of the file.