@jsenv/plugin-react 1.1.5 → 1.1.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-react",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,8 +27,8 @@
27
27
  "@babel/plugin-transform-react-jsx": "7.19.0",
28
28
  "@babel/plugin-transform-react-jsx-development": "7.18.6",
29
29
  "@jsenv/ast": "1.4.4",
30
- "@jsenv/plugin-commonjs": "1.1.0",
31
- "@jsenv/sourcemap": "1.0.6",
30
+ "@jsenv/plugin-commonjs": "1.1.2",
31
+ "@jsenv/sourcemap": "1.0.7",
32
32
  "@jsenv/url-meta": "7.0.0",
33
33
  "react-refresh": "0.14.0"
34
34
  },
@@ -24,6 +24,10 @@ export const jsenvPluginReact = ({
24
24
  "/**/node_modules/react/jsx-runtime/": { external: ["react"] },
25
25
  "/**/node_modules/react/jsx-dev-runtime": { external: ["react"] },
26
26
  "/**/react-refresh/": { external: ["react"] },
27
+ // in case redux is used
28
+ "/**/node_modules/react-is/": true,
29
+ "/**/node_modules/use-sync-external-store/": { external: ["react"] },
30
+ "/**/node_modules/hoist-non-react-statics/": { external: ["react-is"] },
27
31
  },
28
32
  }),
29
33
  jsenvPluginReactRefreshPreamble(),
@@ -69,7 +73,7 @@ const jsenvPluginJsxAndRefresh = ({
69
73
  associations,
70
74
  })
71
75
  const jsxEnabled = urlMeta.jsxTranspilation
72
- const refreshEnabled = context.scenarios.dev
76
+ const refreshEnabled = context.dev
73
77
  ? urlMeta.refreshInstrumentation &&
74
78
  !urlInfo.content.includes("import.meta.hot.decline()")
75
79
  : false
@@ -77,7 +81,7 @@ const jsenvPluginJsxAndRefresh = ({
77
81
  ...(jsxEnabled
78
82
  ? [
79
83
  [
80
- context.scenarios.dev
84
+ context.dev
81
85
  ? "@babel/plugin-transform-react-jsx-development"
82
86
  : "@babel/plugin-transform-react-jsx",
83
87
  {
@@ -114,7 +118,7 @@ const jsenvPluginJsxAndRefresh = ({
114
118
  while (index > -1) {
115
119
  const specifier = importSpecifier.slice(1, -1)
116
120
  const [injectedReference] = context.referenceUtils.inject({
117
- type: "js_import_export",
121
+ type: "js_import",
118
122
  expectedType: "js_module",
119
123
  specifier,
120
124
  })
@@ -133,7 +137,7 @@ const jsenvPluginJsxAndRefresh = ({
133
137
  if (hasReg || hasSig) {
134
138
  const [reactRefreshClientReference] = context.referenceUtils.inject(
135
139
  {
136
- type: "js_import_export",
140
+ type: "js_import",
137
141
  expectedType: "js_module",
138
142
  specifier: "@jsenv/plugin-react/src/client/react_refresh.js",
139
143
  },