@vitejs/plugin-react-swc 3.8.0 → 3.8.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/index.cjs +2 -9
- package/index.mjs +2 -9
- package/package.json +2 -2
package/index.cjs
CHANGED
|
@@ -16,8 +16,6 @@ var resolve = (0, import_module.createRequire)(
|
|
|
16
16
|
).resolve;
|
|
17
17
|
var reactCompRE = /extends\s+(?:React\.)?(?:Pure)?Component/;
|
|
18
18
|
var refreshContentRE = /\$Refresh(?:Reg|Sig)\$\(/;
|
|
19
|
-
var _a, _b;
|
|
20
|
-
var isWebContainer = (_b = (_a = globalThis.process) == null ? void 0 : _a.versions) == null ? void 0 : _b["webcontainer"];
|
|
21
19
|
var react = (_options) => {
|
|
22
20
|
let hmrDisabled = false;
|
|
23
21
|
const options = {
|
|
@@ -57,11 +55,6 @@ var react = (_options) => {
|
|
|
57
55
|
"[vite:react-swc] The MDX plugin should be placed before this plugin"
|
|
58
56
|
);
|
|
59
57
|
}
|
|
60
|
-
if (isWebContainer) {
|
|
61
|
-
config.logger.warn(
|
|
62
|
-
"[vite:react-swc] SWC is currently not supported in WebContainers. You can use the default React plugin instead."
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
58
|
},
|
|
66
59
|
transformIndexHtml: (_, config) => [
|
|
67
60
|
{
|
|
@@ -197,14 +190,14 @@ var transformWithOptions = async (id, code, target, options, reactConfig) => {
|
|
|
197
190
|
var silenceUseClientWarning = (userConfig) => ({
|
|
198
191
|
rollupOptions: {
|
|
199
192
|
onwarn(warning, defaultHandler) {
|
|
200
|
-
var
|
|
193
|
+
var _a, _b;
|
|
201
194
|
if (warning.code === "MODULE_LEVEL_DIRECTIVE" && warning.message.includes("use client")) {
|
|
202
195
|
return;
|
|
203
196
|
}
|
|
204
197
|
if (warning.code === "SOURCEMAP_ERROR" && warning.message.includes("resolve original location") && warning.pos === 0) {
|
|
205
198
|
return;
|
|
206
199
|
}
|
|
207
|
-
if ((
|
|
200
|
+
if ((_b = (_a = userConfig.build) == null ? void 0 : _a.rollupOptions) == null ? void 0 : _b.onwarn) {
|
|
208
201
|
userConfig.build.rollupOptions.onwarn(warning, defaultHandler);
|
|
209
202
|
} else {
|
|
210
203
|
defaultHandler(warning);
|
package/index.mjs
CHANGED
|
@@ -17,8 +17,6 @@ var resolve = createRequire(
|
|
|
17
17
|
).resolve;
|
|
18
18
|
var reactCompRE = /extends\s+(?:React\.)?(?:Pure)?Component/;
|
|
19
19
|
var refreshContentRE = /\$Refresh(?:Reg|Sig)\$\(/;
|
|
20
|
-
var _a, _b;
|
|
21
|
-
var isWebContainer = (_b = (_a = globalThis.process) == null ? void 0 : _a.versions) == null ? void 0 : _b["webcontainer"];
|
|
22
20
|
var react = (_options) => {
|
|
23
21
|
let hmrDisabled = false;
|
|
24
22
|
const options = {
|
|
@@ -58,11 +56,6 @@ var react = (_options) => {
|
|
|
58
56
|
"[vite:react-swc] The MDX plugin should be placed before this plugin"
|
|
59
57
|
);
|
|
60
58
|
}
|
|
61
|
-
if (isWebContainer) {
|
|
62
|
-
config.logger.warn(
|
|
63
|
-
"[vite:react-swc] SWC is currently not supported in WebContainers. You can use the default React plugin instead."
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
59
|
},
|
|
67
60
|
transformIndexHtml: (_, config) => [
|
|
68
61
|
{
|
|
@@ -198,14 +191,14 @@ var transformWithOptions = async (id, code, target, options, reactConfig) => {
|
|
|
198
191
|
var silenceUseClientWarning = (userConfig) => ({
|
|
199
192
|
rollupOptions: {
|
|
200
193
|
onwarn(warning, defaultHandler) {
|
|
201
|
-
var
|
|
194
|
+
var _a, _b;
|
|
202
195
|
if (warning.code === "MODULE_LEVEL_DIRECTIVE" && warning.message.includes("use client")) {
|
|
203
196
|
return;
|
|
204
197
|
}
|
|
205
198
|
if (warning.code === "SOURCEMAP_ERROR" && warning.message.includes("resolve original location") && warning.pos === 0) {
|
|
206
199
|
return;
|
|
207
200
|
}
|
|
208
|
-
if ((
|
|
201
|
+
if ((_b = (_a = userConfig.build) == null ? void 0 : _a.rollupOptions) == null ? void 0 : _b.onwarn) {
|
|
209
202
|
userConfig.build.rollupOptions.onwarn(warning, defaultHandler);
|
|
210
203
|
} else {
|
|
211
204
|
defaultHandler(warning);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitejs/plugin-react-swc",
|
|
3
3
|
"description": "Speed up your Vite dev server with SWC",
|
|
4
|
-
"version": "3.8.
|
|
4
|
+
"version": "3.8.1",
|
|
5
5
|
"author": "Arnaud Barré (https://github.com/ArnaudBarre)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "github:vitejs/vite-plugin-react-swc",
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
"vite": "^4 || ^5 || ^6"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@swc/core": "^1.
|
|
31
|
+
"@swc/core": "^1.11.11"
|
|
32
32
|
}
|
|
33
33
|
}
|