Skip to content

Commit a0f078d

Browse files
committed
feat: remove @svgr/plugin-jsx from core
BREAKING CHANGE: plugin-jsx is no longer included by default in core
1 parent c74b1ec commit a0f078d

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

packages/core/README.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Use `svgr.sync(code, config, state)` if you would like to use sync version.
3434

3535
### Plugins
3636

37-
By default `@svgr/core` doesn't include `svgo` and `prettier` plugins, if you want them, you have to install them and include them in config.
37+
By default `@svgr/core` doesn't include any plugin, if you want them, you have to install them and include them in config.
3838

3939
```js
4040
svgr(svgCode, {
@@ -54,7 +54,3 @@ MIT
5454
[package]: https://www.npmjs.com/package/@svgr/core
5555
[license-badge]: https://img.shields.io/npm/l/@svgr/core.svg?style=flat-square
5656
[license]: https://github.com/smooth-code/svgr/blob/master/LICENSE
57-
58-
```
59-
60-
```

packages/core/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"dependencies": {
4141
"@babel/core": "^7.21.3",
4242
"@svgr/babel-preset": "^6.5.1",
43-
"@svgr/plugin-jsx": "^6.5.1",
4443
"camelcase": "^6.2.0",
4544
"cosmiconfig": "^8.1.3"
4645
}

packages/core/src/plugins.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ describe('#getPlugins', () => {
1616
expect(getPlugins({}, state)).toEqual(['from-state-plugin'])
1717
})
1818

19-
it('should default to ["@svgr/plugin-jsx"]', () => {
20-
expect(getPlugins({}, {})).toEqual([jsx])
19+
it('should default to []', () => {
20+
expect(getPlugins({}, {})).toEqual([])
2121
})
2222

2323
it('should support caller with "defaultPlugins" in second choice', () => {
24-
expect(getPlugins({}, { caller: {} })).toEqual([jsx])
24+
expect(getPlugins({}, { caller: {} })).toEqual([])
2525
})
2626
})
2727

packages/core/src/plugins.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// @ts-ignore
2-
import jsx from '@svgr/plugin-jsx'
31
import { Config } from './config'
42
import type { State } from './state'
53

@@ -9,7 +7,7 @@ export interface Plugin {
97

108
export type ConfigPlugin = string | Plugin
119

12-
const DEFAULT_PLUGINS: Plugin[] = [jsx as any]
10+
const DEFAULT_PLUGINS: Plugin[] = []
1311

1412
export const getPlugins = (
1513
config: Config,

0 commit comments

Comments
 (0)