@jsenv/plugin-react 0.0.5 → 0.0.8

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": "0.0.5",
3
+ "version": "0.0.8",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,9 +28,9 @@
28
28
  "dependencies": {
29
29
  "@babel/plugin-transform-react-jsx": "7.17.3",
30
30
  "@babel/plugin-transform-react-jsx-development": "7.16.7",
31
- "@jsenv/cjs-to-esm": "0.0.2",
31
+ "@jsenv/cjs-to-esm": "0.0.3",
32
32
  "@jsenv/url-meta": "6.2.0",
33
- "@jsenv/utils": "1.7.0",
33
+ "@jsenv/utils": "1.7.3",
34
34
  "react-refresh": "0.13.0"
35
35
  },
36
36
  "peerDependencies": {
@@ -13,9 +13,14 @@ import { fetchOriginalUrlInfo } from "@jsenv/core/src/plugins/transpilation/fetc
13
13
 
14
14
  import { jsenvPluginReactRefreshPreamble } from "./jsenv_plugin_react_refresh_preamble.js"
15
15
 
16
- export const jsenvPluginReact = ({ hotRefreshPatterns } = {}) => {
16
+ export const jsenvPluginReact = ({
17
+ asJsModuleLogLevel,
18
+ hotRefreshPatterns,
19
+ } = {}) => {
17
20
  return [
18
- jsenvPluginReactAsJsModule(),
21
+ jsenvPluginReactAsJsModule({
22
+ asJsModuleLogLevel,
23
+ }),
19
24
  jsenvPluginReactRefreshPreamble(),
20
25
  jsenvPluginJsxAndRefresh({
21
26
  hotRefreshPatterns,
@@ -23,11 +28,11 @@ export const jsenvPluginReact = ({ hotRefreshPatterns } = {}) => {
23
28
  ]
24
29
  }
25
30
 
26
- const jsenvPluginReactAsJsModule = () => {
31
+ const jsenvPluginReactAsJsModule = ({ asJsModuleLogLevel }) => {
27
32
  return {
28
33
  name: "jsenv:react_as_js_module",
29
34
  appliesDuring: "*",
30
- normalizeUrl: {
35
+ redirectUrl: {
31
36
  js_import_export: (reference) => {
32
37
  if (
33
38
  [
@@ -58,6 +63,7 @@ const jsenvPluginReactAsJsModule = () => {
58
63
  return null
59
64
  }
60
65
  const { content, sourcemap } = await commonJsToJsModule({
66
+ logLevel: asJsModuleLogLevel,
61
67
  rootDirectoryUrl: context.rootDirectoryUrl,
62
68
  sourceFileUrl: originalUrlInfo.url,
63
69
  external: ["react"],