Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove @svgr/plugin-jsx from core #841

Merged
merged 3 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
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
20 changes: 0 additions & 20 deletions build/build.sh

This file was deleted.

4 changes: 4 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[build]
base = "website/"
publish = "public/"
command = "npm run build"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"examples/*"
],
"scripts": {
"build": "build/build.sh",
"build": "lerna run build",
"dev": "lerna run build --parallel -- --watch",
"format": "prettier --write .",
"lint": "eslint . && prettier --check .",
Expand Down
6 changes: 1 addition & 5 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Use `svgr.sync(code, config, state)` if you would like to use sync version.

### Plugins

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.
By default `@svgr/core` doesn't include any plugin, if you want them, you have to install them and include them in config.

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

```

```
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"dependencies": {
"@babel/core": "^7.21.3",
"@svgr/babel-preset": "^6.5.1",
"@svgr/plugin-jsx": "^6.5.1",
"camelcase": "^6.2.0",
"cosmiconfig": "^8.1.3"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/plugins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ describe('#getPlugins', () => {
expect(getPlugins({}, state)).toEqual(['from-state-plugin'])
})

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

it('should support caller with "defaultPlugins" in second choice', () => {
expect(getPlugins({}, { caller: {} })).toEqual([jsx])
expect(getPlugins({}, { caller: {} })).toEqual([])
})
})

Expand Down
4 changes: 1 addition & 3 deletions packages/core/src/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-ignore
import jsx from '@svgr/plugin-jsx'
import { Config } from './config'
import type { State } from './state'

Expand All @@ -9,7 +7,7 @@ export interface Plugin {

export type ConfigPlugin = string | Plugin

const DEFAULT_PLUGINS: Plugin[] = [jsx as any]
const DEFAULT_PLUGINS: Plugin[] = []

export const getPlugins = (
config: Config,
Expand Down