@unhead/addons 3.0.0-beta.11 → 3.0.0-beta.12
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.
|
@@ -7,6 +7,8 @@ import { createUnplugin } from 'unplugin';
|
|
|
7
7
|
import { createContext, runInContext } from 'node:vm';
|
|
8
8
|
import { resolveMetaKeyType, resolveMetaKeyValue, resolvePackedMetaObjectValue } from 'unhead/utils';
|
|
9
9
|
|
|
10
|
+
const NODE_MODULES_RE$1 = /[\\/]node_modules[\\/]/;
|
|
11
|
+
const TRANSFORM_RE$1 = /\.(?:(?:c|m)?j|t)sx?$/;
|
|
10
12
|
const functionNames = [
|
|
11
13
|
"useServerHead",
|
|
12
14
|
"useServerHeadSafe",
|
|
@@ -24,7 +26,7 @@ const TreeshakeServerComposables = createUnplugin((options = {}) => {
|
|
|
24
26
|
return false;
|
|
25
27
|
const { pathname, search } = parseURL(decodeURIComponent(pathToFileURL(id).href));
|
|
26
28
|
const { type } = parseQuery(search);
|
|
27
|
-
if (
|
|
29
|
+
if (NODE_MODULES_RE$1.test(pathname))
|
|
28
30
|
return false;
|
|
29
31
|
if (options.filter?.include?.some((pattern) => id.match(pattern)))
|
|
30
32
|
return true;
|
|
@@ -32,7 +34,7 @@ const TreeshakeServerComposables = createUnplugin((options = {}) => {
|
|
|
32
34
|
return false;
|
|
33
35
|
if (pathname.endsWith(".vue") && (type === "script" || !search))
|
|
34
36
|
return true;
|
|
35
|
-
if (
|
|
37
|
+
if (TRANSFORM_RE$1.test(pathname))
|
|
36
38
|
return true;
|
|
37
39
|
return false;
|
|
38
40
|
},
|
|
@@ -72,6 +74,8 @@ const TreeshakeServerComposables = createUnplugin((options = {}) => {
|
|
|
72
74
|
};
|
|
73
75
|
});
|
|
74
76
|
|
|
77
|
+
const NODE_MODULES_RE = /[\\/]node_modules[\\/]/;
|
|
78
|
+
const TRANSFORM_RE = /\.(?:(?:c|m)?j|t)sx?$/;
|
|
75
79
|
const SEO_META_NAMES = /* @__PURE__ */ new Set(["useSeoMeta", "useServerSeoMeta"]);
|
|
76
80
|
const UseSeoMetaTransform = createUnplugin((options = {}) => {
|
|
77
81
|
options.imports = options.imports || true;
|
|
@@ -87,7 +91,7 @@ const UseSeoMetaTransform = createUnplugin((options = {}) => {
|
|
|
87
91
|
transformInclude(id) {
|
|
88
92
|
const { pathname, search } = parseURL(decodeURIComponent(pathToFileURL(id).href));
|
|
89
93
|
const { type } = parseQuery(search);
|
|
90
|
-
if (
|
|
94
|
+
if (NODE_MODULES_RE.test(pathname))
|
|
91
95
|
return false;
|
|
92
96
|
if (options.filter?.include?.some((pattern) => id.match(pattern)))
|
|
93
97
|
return true;
|
|
@@ -95,7 +99,7 @@ const UseSeoMetaTransform = createUnplugin((options = {}) => {
|
|
|
95
99
|
return false;
|
|
96
100
|
if (pathname.endsWith(".vue") && (type === "script" || !search))
|
|
97
101
|
return true;
|
|
98
|
-
if (
|
|
102
|
+
if (TRANSFORM_RE.test(pathname))
|
|
99
103
|
return true;
|
|
100
104
|
return false;
|
|
101
105
|
},
|
|
@@ -244,7 +248,7 @@ const UseSeoMetaTransform = createUnplugin((options = {}) => {
|
|
|
244
248
|
}
|
|
245
249
|
s.overwrite(
|
|
246
250
|
importNode.specifiers[0].start,
|
|
247
|
-
importNode.specifiers
|
|
251
|
+
importNode.specifiers.at(-1).end,
|
|
248
252
|
[...newSpecifiers].join(", ")
|
|
249
253
|
);
|
|
250
254
|
}
|
package/dist/vite.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TreeshakeServerComposables, U as UseSeoMetaTransform } from './shared/addons.
|
|
1
|
+
import { T as TreeshakeServerComposables, U as UseSeoMetaTransform } from './shared/addons.B0i_V9Oi.mjs';
|
|
2
2
|
import 'node:url';
|
|
3
3
|
import 'magic-string';
|
|
4
4
|
import 'oxc-parser';
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TreeshakeServerComposables, U as UseSeoMetaTransform } from './shared/addons.
|
|
1
|
+
import { T as TreeshakeServerComposables, U as UseSeoMetaTransform } from './shared/addons.B0i_V9Oi.mjs';
|
|
2
2
|
import 'node:url';
|
|
3
3
|
import 'magic-string';
|
|
4
4
|
import 'oxc-parser';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/addons",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.12",
|
|
5
5
|
"description": "Unhead addons for build tools and bundlers.",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -52,20 +52,20 @@
|
|
|
52
52
|
"dist"
|
|
53
53
|
],
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"unhead": "^3.0.0-beta.
|
|
55
|
+
"unhead": "^3.0.0-beta.12"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@rollup/pluginutils": "^5.3.0",
|
|
59
59
|
"magic-string": "^0.30.21",
|
|
60
|
-
"oxc-parser": "^0.
|
|
60
|
+
"oxc-parser": "^0.117.0",
|
|
61
61
|
"oxc-walker": "^0.7.0",
|
|
62
|
-
"ufo": "^1.6.
|
|
63
|
-
"unplugin": "^
|
|
62
|
+
"ufo": "^1.6.3",
|
|
63
|
+
"unplugin": "^3.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"rollup": "^4.
|
|
66
|
+
"rollup": "^4.59.0",
|
|
67
67
|
"vite": "^7.3.1",
|
|
68
|
-
"unhead": "3.0.0-beta.
|
|
68
|
+
"unhead": "3.0.0-beta.12"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
71
|
"build": "unbuild",
|