Skip to content

Commit

Permalink
Merge pull request #841 from gregberge/no-cycle-build
Browse files Browse the repository at this point in the history
feat: remove @svgr/plugin-jsx from core
  • Loading branch information
gregberge committed Mar 24, 2023
2 parents c74b1ec + b7477c6 commit 279ffe2
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 33 deletions.
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

1 comment on commit 279ffe2

@vercel
Copy link

@vercel vercel bot commented on 279ffe2 Mar 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

svgr – ./

svgr-gregberge.vercel.app
svgr-git-main-gregberge.vercel.app
api.react-svgr.com

Please sign in to comment.