Skip to content

Commit cc83bee

Browse files
authored
Update README.md
1 parent 8cdcfe3 commit cc83bee

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

template/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ There is currently no support for preprocessors such as Less, or for sharing var
163163
With Webpack, using static assets like images and fonts works similarly to CSS.
164164

165165
You can `import` an image right in a JavaScript. This tells Webpack to include that image in the bundle.
166-
The *result* of the import will be the final image filename in the compiled bundle.
166+
The *result* of the import is the image filename from the build output folder.
167167

168168
Here is an example:
169169

@@ -181,20 +181,21 @@ function Header() {
181181
export default function Header;
182182
```
183183

184-
You can also use images in CSS with relative module paths:
184+
This works in CSS too:
185185

186186
```css
187187
.Logo {
188188
background-image: url(./logo.png);
189189
}
190190
```
191191

192-
Webpack will thefind relative module references in CSS (they start with `./`) and replace them with the final paths in the compiled bundle. If you make a typo or accidentally delete an important file, you will see a compilation error, just like when you import a non-existent JavaScript module.
192+
Webpack finds all relative module references in CSS (they start with `./`) and replaces them with the final paths from the compiled bundle.
193193

194-
The filenames are generated by Webpack from content hashes. If the file content changes in the future, Webpack will give it a different name in production so you don’t need to worry about long-term caching of assets.
194+
If you make a typo or accidentally delete an important file, you will see a compilation error, just like when you import a non-existent JavaScript module. The filenames are generated by Webpack from content hashes. If the file content changes in the future, Webpack will give it a different name in production so you don’t need to worry about long-term caching of assets.
195195

196196
Please be advised that this is also a custom feature of Webpack.
197-
**It is not required for React** but many people enjoy it (and React Native uses a similar mechanism for images).
197+
**It is not required for React** but many people enjoy it (and React Native uses a similar mechanism for images).
198+
However it may not be portable to some other environments (for example, Node.js and Browserify).
198199

199200
If you’d prefer to add and reference static assets in a more traditional way outside the module system, please let us know [in this issue](https://github.com/facebookincubator/create-react-app/issues/28), and we will add support for this.
200201

0 commit comments

Comments
 (0)