Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

fix(readme): use the prepacked logo.svg as an example in "Adding Imag… #268

Merged
merged 1 commit into from
Mar 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -638,15 +638,17 @@ declare module "*.gif";
declare module "*.jpg";
declare module "*.jpeg";
declare module "*.png";
declare module "*.svg";
```
(you'll have to restart the compiler in order the changes to take place)

In this case, we've added several image file extensions as valid module formats.

Now that the compiler is configured, here is an example of importing an image file:

```js
import React from 'react';
import logo from './logo.png'; // Tell Webpack this JS file uses this image
import logo from './logo.svg'; // Tell Webpack this JS file uses this image

console.log(logo); // /logo.84287d09.png

Expand Down