Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into fix-webpack-ts-comp…
Browse files Browse the repository at this point in the history
…ilation
  • Loading branch information
smol-honk committed Aug 25, 2021
2 parents 535e6bf + 81f2b80 commit 77045d5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
10 changes: 5 additions & 5 deletions packages/webpack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,14 @@ By default, `@svgr/webpack` includes a `babel-loader` with [an optimized configu

### Handle SVG in CSS, Sass or Less

It is possible to detect the module that requires your SVG using [`Rule.issuer`](https://webpack.js.org/configuration/module/#rule-issuer) in Webpack. Using it you can specify two different configurations for JavaScript and the rest of your files.
It is possible to detect the module that requires your SVG using [`Rule.issuer`](https://webpack.js.org/configuration/module/#ruleissuer) in Webpack 5. Using it you can specify two different configurations for JavaScript and the rest of your files.

```js
[
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
issuer: {
test: /\.jsx?$/,
},
use: ['babel-loader', '@svgr/webpack', 'url-loader'],
issuer: /\.[jt]sx?$/,
use: ['babel-loader', '@svgr/webpack', 'url-loader']
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
Expand All @@ -120,6 +118,8 @@ It is possible to detect the module that requires your SVG using [`Rule.issuer`]
]
```

_[Rule.issuer](https://v4.webpack.js.org/configuration/module/#ruleissuer) in Webpack 4 has additional conditions which are not available in Webpack 5._

## License

MIT
1 change: 1 addition & 0 deletions website/src/pages/docs/ecosystem.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This is an incomplete list of awesome things built with svgr. If you have someth

- [Create React App](https://facebook.github.io/create-react-app/)
- [React SSR Setup](https://github.com/manuelbieh/react-ssr-setup)
- [SVG Gobbler Browser Extension](https://github.com/rossmoody/svg-gobbler)

## Conferences

Expand Down
12 changes: 6 additions & 6 deletions website/src/pages/docs/webpack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,20 @@ By default, `@svgr/webpack` includes a `babel-loader` with [an optimized configu

### Handle SVG in CSS, Sass or Less

It is possible to detect the module that requires your SVG using [`Rule.issuer`](https://webpack.js.org/configuration/module/#rule-issuer) in Webpack. Using it you can specify two different configurations for JavaScript and the rest of your files.
It is possible to detect the module that requires your SVG using [`Rule.issuer`](https://webpack.js.org/configuration/module/#ruleissuer) in Webpack 5. Using it you can specify two different configurations for JavaScript and the rest of your files.

```js
{
[
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
issuer: {
test: /\.jsx?$/
},
issuer: /\.[jt]sx?$/,
use: ['babel-loader', '@svgr/webpack', 'url-loader']
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader'
},
}
]
```

_[Rule.issuer](https://v4.webpack.js.org/configuration/module/#ruleissuer) in Webpack 4 has additional conditions which are not available in Webpack 5._

0 comments on commit 77045d5

Please sign in to comment.