@vitejs/plugin-react 1.1.4 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +33 -31
- package/package.json +12 -12
- package/src/fast-refresh.ts +7 -2
- package/src/index.ts +16 -4
- package/src/jsx-runtime/restore-jsx.ts +2 -1
- package/CHANGELOG.md +0 -132
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
@@ -23,6 +23,12 @@ export declare interface Options {
|
|
23
23
|
* @default "react"
|
24
24
|
*/
|
25
25
|
jsxImportSource?: string;
|
26
|
+
/**
|
27
|
+
* Set this to `true` to annotate the JSX factory with `\/* @__PURE__ *\/`.
|
28
|
+
* This option is ignored when `jsxRuntime` is not `"automatic"`.
|
29
|
+
* @default true
|
30
|
+
*/
|
31
|
+
jsxPure?: boolean;
|
26
32
|
/**
|
27
33
|
* Babel configuration applied in both dev and prod.
|
28
34
|
*/
|
@@ -40,6 +46,7 @@ export declare interface Options {
|
|
40
46
|
export declare interface ReactBabelOptions extends BabelOptions {
|
41
47
|
plugins: Extract<BabelOptions['plugins'], any[]>;
|
42
48
|
presets: Extract<BabelOptions['presets'], any[]>;
|
49
|
+
overrides: Extract<BabelOptions['overrides'], any[]>;
|
43
50
|
parserOpts: ParserOptions & {
|
44
51
|
plugins: Extract<ParserOptions['plugins'], any[]>;
|
45
52
|
};
|
package/dist/index.js
CHANGED
@@ -21,26 +21,23 @@ var __spreadValues = (a, b) => {
|
|
21
21
|
return a;
|
22
22
|
};
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
25
24
|
var __esm = (fn, res) => function __init() {
|
26
|
-
return fn && (res = (0, fn[
|
25
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
27
26
|
};
|
28
27
|
var __export = (target, all) => {
|
29
|
-
__markAsModule(target);
|
30
28
|
for (var name in all)
|
31
29
|
__defProp(target, name, { get: all[name], enumerable: true });
|
32
30
|
};
|
33
|
-
var
|
34
|
-
if (
|
35
|
-
for (let key of __getOwnPropNames(
|
36
|
-
if (!__hasOwnProp.call(
|
37
|
-
__defProp(
|
31
|
+
var __copyProps = (to, from, except, desc) => {
|
32
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
33
|
+
for (let key of __getOwnPropNames(from))
|
34
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
35
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
38
36
|
}
|
39
|
-
return
|
40
|
-
};
|
41
|
-
var __toModule = (module2) => {
|
42
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
37
|
+
return to;
|
43
38
|
};
|
39
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
40
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
44
41
|
|
45
42
|
// src/jsx-runtime/babel-restore-jsx.ts
|
46
43
|
var babel_restore_jsx_exports = {};
|
@@ -154,12 +151,12 @@ function babel_restore_jsx_default({ types: t }) {
|
|
154
151
|
const isPlainObjectExpression = (node) => t.isObjectExpression(node) && node.properties.every((property) => t.isSpreadElement(property) || t.isObjectProperty(property, { computed: false }) && getJSXIdentifier(property.key) != null && getJSXAttributeValue(property.value) != null);
|
155
152
|
return {
|
156
153
|
visitor: {
|
157
|
-
CallExpression(
|
158
|
-
const node = getJSXNode(
|
154
|
+
CallExpression(path2) {
|
155
|
+
const node = getJSXNode(path2.node);
|
159
156
|
if (node == null) {
|
160
157
|
return null;
|
161
158
|
}
|
162
|
-
|
159
|
+
path2.replaceWith(node);
|
163
160
|
}
|
164
161
|
}
|
165
162
|
};
|
@@ -170,17 +167,22 @@ var init_babel_restore_jsx = __esm({
|
|
170
167
|
});
|
171
168
|
|
172
169
|
// src/index.ts
|
173
|
-
|
170
|
+
var src_exports = {};
|
171
|
+
__export(src_exports, {
|
174
172
|
default: () => viteReact
|
175
173
|
});
|
176
|
-
|
177
|
-
|
178
|
-
var
|
174
|
+
module.exports = viteReact;
|
175
|
+
viteReact['default'] = viteReact;
|
176
|
+
var babel = __toESM(require("@babel/core"));
|
177
|
+
var import_pluginutils = require("@rollup/pluginutils");
|
178
|
+
var import_resolve = __toESM(require("resolve"));
|
179
179
|
|
180
180
|
// src/fast-refresh.ts
|
181
|
-
var import_fs =
|
181
|
+
var import_fs = __toESM(require("fs"));
|
182
|
+
var import_path = __toESM(require("path"));
|
182
183
|
var runtimePublicPath = "/@react-refresh";
|
183
|
-
var
|
184
|
+
var reactRefreshDir = import_path.default.dirname(require.resolve("react-refresh/package.json"));
|
185
|
+
var runtimeFilePath = import_path.default.join(reactRefreshDir, "cjs/react-refresh-runtime.development.js");
|
184
186
|
var runtimeCode = `
|
185
187
|
const exports = {}
|
186
188
|
${import_fs.default.readFileSync(runtimeFilePath, "utf-8")}
|
@@ -268,10 +270,10 @@ function isComponentLikeName(name) {
|
|
268
270
|
function babelImportToRequire({ types: t }) {
|
269
271
|
return {
|
270
272
|
visitor: {
|
271
|
-
ImportDeclaration(
|
272
|
-
const decl =
|
273
|
+
ImportDeclaration(path2) {
|
274
|
+
const decl = path2.node;
|
273
275
|
const spec = decl.specifiers[0];
|
274
|
-
|
276
|
+
path2.replaceWith(t.variableDeclaration("var", [
|
275
277
|
t.variableDeclarator(spec.local, t.memberExpression(t.callExpression(t.identifier("require"), [decl.source]), spec.imported))
|
276
278
|
]));
|
277
279
|
}
|
@@ -310,7 +312,7 @@ async function restoreJSX(babel2, code, filename) {
|
|
310
312
|
parserOpts: {
|
311
313
|
plugins: ["jsx"]
|
312
314
|
},
|
313
|
-
plugins: [await babelRestoreJSX]
|
315
|
+
plugins: [(await babelRestoreJSX).default]
|
314
316
|
});
|
315
317
|
return [result == null ? void 0 : result.ast, isCommonJS];
|
316
318
|
}
|
@@ -342,6 +344,7 @@ function viteReact(opts = {}) {
|
|
342
344
|
}, opts.babel);
|
343
345
|
babelOptions.plugins || (babelOptions.plugins = []);
|
344
346
|
babelOptions.presets || (babelOptions.presets = []);
|
347
|
+
babelOptions.overrides || (babelOptions.overrides = []);
|
345
348
|
babelOptions.parserOpts || (babelOptions.parserOpts = {});
|
346
349
|
(_a = babelOptions.parserOpts).plugins || (_a.plugins = opts.parserPlugins || []);
|
347
350
|
const importReactRE = /(^|\n)import\s+(\*\s+as\s+)?React(,|\s+)/;
|
@@ -387,7 +390,7 @@ function viteReact(opts = {}) {
|
|
387
390
|
if (isReactModule && filter(id)) {
|
388
391
|
useFastRefresh = true;
|
389
392
|
plugins.push([
|
390
|
-
await loadPlugin("react-refresh/babel
|
393
|
+
await loadPlugin("react-refresh/babel"),
|
391
394
|
{ skipEnvCheck: true }
|
392
395
|
]);
|
393
396
|
}
|
@@ -401,7 +404,8 @@ function viteReact(opts = {}) {
|
|
401
404
|
await loadPlugin("@babel/plugin-transform-react-jsx" + (isProduction ? "" : "-development")),
|
402
405
|
{
|
403
406
|
runtime: "automatic",
|
404
|
-
importSource: opts.jsxImportSource
|
407
|
+
importSource: opts.jsxImportSource,
|
408
|
+
pure: opts.jsxPure !== false
|
405
409
|
}
|
406
410
|
]);
|
407
411
|
if (isCommonJS) {
|
@@ -527,11 +531,9 @@ function viteReact(opts = {}) {
|
|
527
531
|
return [viteBabel, viteReactRefresh, useAutomaticRuntime && viteReactJsx];
|
528
532
|
}
|
529
533
|
viteReact.preambleCode = preambleCode;
|
530
|
-
function loadPlugin(
|
531
|
-
return Promise.resolve().then(() =>
|
534
|
+
function loadPlugin(path2) {
|
535
|
+
return Promise.resolve().then(() => __toESM(require(path2))).then((module2) => module2.default || module2);
|
532
536
|
}
|
533
|
-
module.exports = viteReact;
|
534
|
-
viteReact["default"] = viteReact;
|
535
537
|
// Annotate the CommonJS export names for ESM import in node:
|
536
538
|
0 && (module.exports = {});
|
537
539
|
/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vitejs/plugin-react",
|
3
|
-
"version": "1.1
|
3
|
+
"version": "1.3.1",
|
4
4
|
"license": "MIT",
|
5
5
|
"author": "Evan You",
|
6
6
|
"contributors": [
|
@@ -15,10 +15,10 @@
|
|
15
15
|
"scripts": {
|
16
16
|
"dev": "tsc -p . -w --incremental",
|
17
17
|
"build": "rimraf dist && run-s build-bundle build-types",
|
18
|
-
"build-bundle": "esbuild src/index.ts --bundle --platform=node --target=node12 --external:@babel/* --external:@rollup/* --external:resolve --external:react-refresh/* --outfile=dist/index.js",
|
18
|
+
"build-bundle": "esbuild src/index.ts --bundle --platform=node --target=node12 --external:@babel/* --external:@rollup/* --external:resolve --external:react-refresh/* --outfile=dist/index.js && npm run patch-dist",
|
19
|
+
"patch-dist": "ts-node ../../scripts/patchEsbuildDist.ts dist/index.js viteReact",
|
19
20
|
"build-types": "tsc -p . --emitDeclarationOnly --outDir temp && api-extractor run && rimraf temp",
|
20
|
-
"
|
21
|
-
"release": "ts-node ../../scripts/release.ts"
|
21
|
+
"prepublishOnly": "(cd ../vite && npm run build) && npm run build"
|
22
22
|
},
|
23
23
|
"engines": {
|
24
24
|
"node": ">=12.0.0"
|
@@ -33,13 +33,13 @@
|
|
33
33
|
},
|
34
34
|
"homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-react#readme",
|
35
35
|
"dependencies": {
|
36
|
-
"@babel/core": "^7.
|
37
|
-
"@babel/plugin-transform-react-jsx": "^7.
|
38
|
-
"@babel/plugin-transform-react-jsx-development": "^7.16.
|
39
|
-
"@babel/plugin-transform-react-jsx-self": "^7.16.
|
40
|
-
"@babel/plugin-transform-react-jsx-source": "^7.16.
|
41
|
-
"@rollup/pluginutils": "^4.
|
42
|
-
"react-refresh": "^0.
|
43
|
-
"resolve": "^1.
|
36
|
+
"@babel/core": "^7.17.9",
|
37
|
+
"@babel/plugin-transform-react-jsx": "^7.17.3",
|
38
|
+
"@babel/plugin-transform-react-jsx-development": "^7.16.7",
|
39
|
+
"@babel/plugin-transform-react-jsx-self": "^7.16.7",
|
40
|
+
"@babel/plugin-transform-react-jsx-source": "^7.16.7",
|
41
|
+
"@rollup/pluginutils": "^4.2.0",
|
42
|
+
"react-refresh": "^0.12.0",
|
43
|
+
"resolve": "^1.22.0"
|
44
44
|
}
|
45
45
|
}
|
package/src/fast-refresh.ts
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
import type { types as t } from '@babel/core'
|
2
2
|
import fs from 'fs'
|
3
|
+
import path from 'path'
|
3
4
|
|
4
5
|
export const runtimePublicPath = '/@react-refresh'
|
5
6
|
|
6
|
-
const
|
7
|
-
'react-refresh/
|
7
|
+
const reactRefreshDir = path.dirname(
|
8
|
+
require.resolve('react-refresh/package.json')
|
9
|
+
)
|
10
|
+
const runtimeFilePath = path.join(
|
11
|
+
reactRefreshDir,
|
12
|
+
'cjs/react-refresh-runtime.development.js'
|
8
13
|
)
|
9
14
|
|
10
15
|
export const runtimeCode = `
|
package/src/index.ts
CHANGED
@@ -32,6 +32,12 @@ export interface Options {
|
|
32
32
|
* @default "react"
|
33
33
|
*/
|
34
34
|
jsxImportSource?: string
|
35
|
+
/**
|
36
|
+
* Set this to `true` to annotate the JSX factory with `\/* @__PURE__ *\/`.
|
37
|
+
* This option is ignored when `jsxRuntime` is not `"automatic"`.
|
38
|
+
* @default true
|
39
|
+
*/
|
40
|
+
jsxPure?: boolean
|
35
41
|
|
36
42
|
/**
|
37
43
|
* Babel configuration applied in both dev and prod.
|
@@ -60,6 +66,7 @@ export type BabelOptions = Omit<
|
|
60
66
|
export interface ReactBabelOptions extends BabelOptions {
|
61
67
|
plugins: Extract<BabelOptions['plugins'], any[]>
|
62
68
|
presets: Extract<BabelOptions['presets'], any[]>
|
69
|
+
overrides: Extract<BabelOptions['overrides'], any[]>
|
63
70
|
parserOpts: ParserOptions & {
|
64
71
|
plugins: Extract<ParserOptions['plugins'], any[]>
|
65
72
|
}
|
@@ -95,6 +102,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
|
|
95
102
|
|
96
103
|
babelOptions.plugins ||= []
|
97
104
|
babelOptions.presets ||= []
|
105
|
+
babelOptions.overrides ||= []
|
98
106
|
babelOptions.parserOpts ||= {} as any
|
99
107
|
babelOptions.parserOpts.plugins ||= opts.parserPlugins || []
|
100
108
|
|
@@ -168,7 +176,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
|
|
168
176
|
if (isReactModule && filter(id)) {
|
169
177
|
useFastRefresh = true
|
170
178
|
plugins.push([
|
171
|
-
await loadPlugin('react-refresh/babel
|
179
|
+
await loadPlugin('react-refresh/babel'),
|
172
180
|
{ skipEnvCheck: true }
|
173
181
|
])
|
174
182
|
}
|
@@ -193,7 +201,8 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
|
|
193
201
|
),
|
194
202
|
{
|
195
203
|
runtime: 'automatic',
|
196
|
-
importSource: opts.jsxImportSource
|
204
|
+
importSource: opts.jsxImportSource,
|
205
|
+
pure: opts.jsxPure !== false
|
197
206
|
}
|
198
207
|
])
|
199
208
|
|
@@ -366,5 +375,8 @@ function loadPlugin(path: string): Promise<any> {
|
|
366
375
|
}
|
367
376
|
|
368
377
|
// overwrite for cjs require('...')() usage
|
369
|
-
|
370
|
-
|
378
|
+
// The following lines are inserted by scripts/patchEsbuildDist.ts,
|
379
|
+
// this doesn't bundle correctly after esbuild 0.14.4
|
380
|
+
//
|
381
|
+
// module.exports = viteReact
|
382
|
+
// viteReact['default'] = viteReact
|
package/CHANGELOG.md
DELETED
@@ -1,132 +0,0 @@
|
|
1
|
-
## [1.1.4](https://github.com/vitejs/vite/compare/plugin-react@1.1.3...plugin-react@1.1.4) (2022-01-04)
|
2
|
-
|
3
|
-
|
4
|
-
### Bug Fixes
|
5
|
-
|
6
|
-
* **plugin-react:** check for import React statement in .js files ([#6320](https://github.com/vitejs/vite/issues/6320)) ([bd9e97b](https://github.com/vitejs/vite/commit/bd9e97bd1b9156059b78b531871a12f6f47c04b1)), closes [#6148](https://github.com/vitejs/vite/issues/6148) [#6148](https://github.com/vitejs/vite/issues/6148)
|
7
|
-
* **plugin-react:** restore-jsx bug when component name is lowercase ([#6110](https://github.com/vitejs/vite/issues/6110)) ([ce65c56](https://github.com/vitejs/vite/commit/ce65c567a64fad3be4209cbd1132e62e905fe349))
|
8
|
-
|
9
|
-
|
10
|
-
### Features
|
11
|
-
|
12
|
-
* **plugin-react:** check for `api.reactBabel` on other plugins ([#5454](https://github.com/vitejs/vite/issues/5454)) ([2ab41b3](https://github.com/vitejs/vite/commit/2ab41b3184d2452be4fa0b427f05c791311644aa))
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
## [1.1.3](https://github.com/vitejs/vite/compare/plugin-react@1.1.2...plugin-react@1.1.3) (2021-12-13)
|
17
|
-
|
18
|
-
|
19
|
-
### Bug Fixes
|
20
|
-
|
21
|
-
* **plugin-react:** only detect preamble in hmr context ([#6096](https://github.com/vitejs/vite/issues/6096)) ([8735294](https://github.com/vitejs/vite/commit/8735294055ce16308a6b8302eba4538f4a2931d0))
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
## [1.1.2](https://github.com/vitejs/vite/compare/plugin-react@1.1.1...plugin-react@1.1.2) (2021-12-13)
|
26
|
-
|
27
|
-
|
28
|
-
### Bug Fixes
|
29
|
-
|
30
|
-
* ignore babel config when running restore-jsx ([#6047](https://github.com/vitejs/vite/issues/6047)) ([9c2843c](https://github.com/vitejs/vite/commit/9c2843cf0506844ee32f042a04c22c440434df2a))
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
## [1.1.1](https://github.com/vitejs/vite/compare/plugin-react@1.1.0...plugin-react@1.1.1) (2021-12-07)
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
# [1.1.0](https://github.com/vitejs/vite/compare/plugin-react@1.1.0-beta.1...plugin-react@1.1.0) (2021-11-22)
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
# [1.1.0-beta.1](https://github.com/vitejs/vite/compare/plugin-react@1.1.0-beta.0...plugin-react@1.1.0-beta.1) (2021-11-19)
|
43
|
-
|
44
|
-
|
45
|
-
### Bug Fixes
|
46
|
-
|
47
|
-
* **plugin-react:** apply `babel.plugins` to project files only ([#5255](https://github.com/vitejs/vite/issues/5255)) ([377d0be](https://github.com/vitejs/vite/commit/377d0be5cf85a50240e160beaaafda77b7199452))
|
48
|
-
* **plugin-react:** remove querystring from sourcemap filename ([#5760](https://github.com/vitejs/vite/issues/5760)) ([d93a9fa](https://github.com/vitejs/vite/commit/d93a9fab8986f3659e79d7b0b065e99ef625a5dd))
|
49
|
-
* **plugin-react:** restore usage of extension instead of id ([#5761](https://github.com/vitejs/vite/issues/5761)) ([59471b1](https://github.com/vitejs/vite/commit/59471b186612d3da0083543e23d660747d3287f3))
|
50
|
-
* **plugin-react:** uncompiled JSX in linked pkgs ([#5669](https://github.com/vitejs/vite/issues/5669)) ([41a7c9c](https://github.com/vitejs/vite/commit/41a7c9ccfbc1a7bc60aec672056eac3966ddd036))
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
# [1.1.0-beta.0](https://github.com/vitejs/vite/compare/plugin-react@1.0.6...plugin-react@1.1.0-beta.0) (2021-10-28)
|
55
|
-
|
56
|
-
|
57
|
-
### Bug Fixes
|
58
|
-
|
59
|
-
* **plugin-react:** avoid mangling the sourcemaps of virtual modules ([#5421](https://github.com/vitejs/vite/issues/5421)) ([8556ffe](https://github.com/vitejs/vite/commit/8556ffe3c59952d7e64565422bf433699e97756e))
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
## [1.0.6](https://github.com/vitejs/vite/compare/plugin-react@1.0.5...plugin-react@1.0.6) (2021-10-25)
|
64
|
-
|
65
|
-
|
66
|
-
### Bug Fixes
|
67
|
-
|
68
|
-
* **plugin-react:** account for querystring in transform hook ([#5333](https://github.com/vitejs/vite/issues/5333)) ([13c3813](https://github.com/vitejs/vite/commit/13c381368caf8302a0c5b7cec07dfc0eb344bede))
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
## [1.0.5](https://github.com/vitejs/vite/compare/plugin-react@1.0.4...plugin-react@1.0.5) (2021-10-18)
|
73
|
-
|
74
|
-
|
75
|
-
### Bug Fixes
|
76
|
-
|
77
|
-
* **plugin-react:** fix regex for react imports ([#5274](https://github.com/vitejs/vite/issues/5274)) ([00b3e4f](https://github.com/vitejs/vite/commit/00b3e4fe102652b2d92e76a05e8c7a5b766b1d03))
|
78
|
-
* **plugin-react:** transform .mjs files ([#5314](https://github.com/vitejs/vite/issues/5314)) ([8ce2ea1](https://github.com/vitejs/vite/commit/8ce2ea17d51b80c660f2cdca7844d4fc6991baed))
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
## [1.0.4](https://github.com/vitejs/vite/compare/plugin-react@1.0.3...plugin-react@1.0.4) (2021-10-11)
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
## [1.0.3](https://github.com/vitejs/vite/compare/plugin-react@1.0.2...plugin-react@1.0.3) (2021-10-11)
|
87
|
-
|
88
|
-
|
89
|
-
### Bug Fixes
|
90
|
-
|
91
|
-
* **plugin-react:** turn off jsx for .ts ([#5198](https://github.com/vitejs/vite/issues/5198)) ([916f9d3](https://github.com/vitejs/vite/commit/916f9d3984d5e83f7cb869b3606a1f043a814b97)), closes [#5102](https://github.com/vitejs/vite/issues/5102)
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
## [1.0.2](https://github.com/vitejs/vite/compare/plugin-react@1.0.1...plugin-react@1.0.2) (2021-10-05)
|
96
|
-
|
97
|
-
|
98
|
-
### Bug Fixes
|
99
|
-
|
100
|
-
* **plugin-react:** respect `opts.fastRefresh` in viteBabel ([#5139](https://github.com/vitejs/vite/issues/5139)) ([5cf4e69](https://github.com/vitejs/vite/commit/5cf4e69cd3afc7f960e02072171c7c441747e8f0))
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
## [1.0.1](https://github.com/vitejs/vite/compare/plugin-react@1.0.0...plugin-react@1.0.1) (2021-09-22)
|
105
|
-
|
106
|
-
|
107
|
-
### Bug Fixes
|
108
|
-
|
109
|
-
* **plugin-react:** inconsistent error warning ([#5031](https://github.com/vitejs/vite/issues/5031)) ([89ba8ce](https://github.com/vitejs/vite/commit/89ba8cedb8636968516bc38b37e1d2d5ed6234bb))
|
110
|
-
|
111
|
-
|
112
|
-
### Features
|
113
|
-
|
114
|
-
* **plugin-react:** pre-optimize jsx-dev-runtime ([#5036](https://github.com/vitejs/vite/issues/5036)) ([a34dd27](https://github.com/vitejs/vite/commit/a34dd2725e64fedf626e23ba9ced480f5465a59b))
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
# [1.0.0](https://github.com/vitejs/vite/compare/plugin-react@1.0.0-beta.0...plugin-react@1.0.0) (2021-09-22)
|
119
|
-
|
120
|
-
See the [readme](https://github.com/aleclarson/vite/blob/f8129ce6e87684eb7a4edd8106351c5d98207d7b/packages/plugin-react/README.md#vitejsplugin-react-) for more information.
|
121
|
-
|
122
|
-
- Support for [automatic JSX runtime](https://github.com/alloc/vite-react-jsx)
|
123
|
-
- Babel integration for both development and production builds
|
124
|
-
- Add `react` and `react-dom` to [`resolve.dedupe`](https://vitejs.dev/config/#resolve-dedupe) automatically
|
125
|
-
|
126
|
-
Thanks to @aleclarson and @pengx17 for preparing this release!
|
127
|
-
|
128
|
-
# Legacy
|
129
|
-
|
130
|
-
Before `@vitejs/plugin-react`, there was `@vitejs/plugin-react-refresh`.
|
131
|
-
|
132
|
-
See its changelog [here.](https://github.com/vitejs/vite/blob/b9e837a2aa2c1a7a8f93d4b19df9f72fd3c6fb09/packages/plugin-react-refresh/CHANGELOG.md)
|