@jsenv/plugin-react 0.0.16 → 0.0.17

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.16",
3
+ "version": "0.0.17",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,8 +28,8 @@
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/plugin-commonjs": "0.0.5",
32
- "@jsenv/url-meta": "6.2.0",
31
+ "@jsenv/plugin-commonjs": "0.0.7",
32
+ "@jsenv/urls": "1.0.0",
33
33
  "@jsenv/utils": "1.8.3",
34
34
  "react-refresh": "0.13.0"
35
35
  },
@@ -2,8 +2,7 @@
2
2
  * - https://github.com/vitejs/vite/blob/main/packages/plugin-react/src/index.ts
3
3
  */
4
4
 
5
- import { normalizeStructuredMetaMap, urlToMeta } from "@jsenv/url-meta"
6
-
5
+ import { URL_META } from "@jsenv/urls"
7
6
  import { applyBabelPlugins } from "@jsenv/utils/js_ast/apply_babel_plugins.js"
8
7
  import { createMagicSource } from "@jsenv/utils/sourcemap/magic_source.js"
9
8
  import { composeTwoSourcemaps } from "@jsenv/utils/sourcemap/sourcemap_composition_v3.js"
@@ -44,7 +43,7 @@ const jsenvPluginJsxAndRefresh = ({
44
43
  "./**/*.tsx": true,
45
44
  },
46
45
  }) => {
47
- const structuredMetaMap = normalizeStructuredMetaMap(
46
+ const associations = URL_META.resolveAssociations(
48
47
  {
49
48
  jsx: jsxInclude,
50
49
  refresh: refreshInclude,
@@ -57,7 +56,10 @@ const jsenvPluginJsxAndRefresh = ({
57
56
  appliesDuring: "*",
58
57
  transformUrlContent: {
59
58
  js_module: async (urlInfo, { scenario, referenceUtils }) => {
60
- const urlMeta = urlToMeta({ url: urlInfo.url, structuredMetaMap })
59
+ const urlMeta = URL_META.applyAssociations({
60
+ url: urlInfo.url,
61
+ associations,
62
+ })
61
63
  const jsxEnabled = urlMeta.jsx
62
64
  const refreshEnabled = scenario === "dev" ? urlMeta.refresh : false
63
65
  const babelPlugins = [