-
Notifications
You must be signed in to change notification settings - Fork 95
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
What is the best method fo loading static resources? #18
Comments
Hey, sure thing. You can use https://github.com/webpack/file-loader and loader to web pack config { test: /\.(png|jpg|svg)$/, loader: 'file?name=/[name]-[hash].[ext]' } |
Give me second, I'll prepare you a demo |
Checkout git diff here: https://github.com/werein/react/compare/feature/images |
Thanks Jiri. Your instructions are crystal clear but I get this error:
I have a png file loaded in logo.png. I have placed your loader in my webpack.development.js. All I see is a broken image in the browser. |
It says that you need a loader which I forgot to save in packages.json
|
For whatever reason, the loader code didn't work for me in Webpack config but when I used it in the component like this: I could successfully render the logo with an img tag with src={logo} , Many thanks. |
Hi,
I'm trying to load a logo.png file. I created a directory /public/images. I have attempted to use github: tcoopman/image-webpack-loader although I may have misused this or it may not be the correct loader.
Do you have any guidance on how to load images using your boilerplate?
Thanks
The text was updated successfully, but these errors were encountered: