Skip to content

Commit 7d0a187

Browse files
committed
Added docs for handling images
1 parent ff4232d commit 7d0a187

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/FAQ.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,16 @@ In short, Gulp is an unnecessary abstraction that creates more problems than it
175175
### Why does package.json reference the exact version?
176176
This assures that the build won't break when some new version is released. Unfortunately, many package authors don't properly honor [Semantic Versioning](http://semver.org), so instead, as new versions are released, I'll test them and then introduce them into the starter kit. But yes, this means when you do `npm update` no new dependencies will be pulled down. You'll have to update package.json with the new version manually.
177177

178+
### How do I handle images?
179+
Via <a href="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/webpack/file-loader">Webpack's file loader</a>. Example:
180+
181+
```
182+
<img src={require('./src/images/myImage.jpg')} />
183+
184+
```
185+
186+
Webpack will then intelligently handle your image for you. For the production build, it will copy the physical file to /dist, give it a unique filename, and insert the appropriate path in your image tag.
187+
178188
### I'm getting an error when running npm install: Failed to locate "CL.exe"
179189
On Windows, you need to install extra dependencies for browser-sync to build and install successfully. Follow the getting started steps above to assure you have the necessary dependencies on your machine.
180190

0 commit comments

Comments
 (0)