@unhead/addons 1.1.0 → 1.1.2
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.
|
@@ -23,6 +23,8 @@ const TreeshakeServerComposables = unplugin.createUnplugin(() => {
|
|
|
23
23
|
transformInclude(id) {
|
|
24
24
|
const { pathname, search } = ufo.parseURL(decodeURIComponent(node_url.pathToFileURL(id).href));
|
|
25
25
|
const { type } = ufo.parseQuery(search);
|
|
26
|
+
if (pathname.includes("node_modules"))
|
|
27
|
+
return false;
|
|
26
28
|
if (pathname.endsWith(".vue") && (type === "script" || !search))
|
|
27
29
|
return true;
|
|
28
30
|
if (pathname.match(/\.((c|m)?j|t)sx?$/g))
|
|
@@ -55,9 +57,6 @@ const TreeshakeServerComposables = unplugin.createUnplugin(() => {
|
|
|
55
57
|
;
|
|
56
58
|
},
|
|
57
59
|
vite: {
|
|
58
|
-
async config(config) {
|
|
59
|
-
root = root || config.root || process.cwd();
|
|
60
|
-
},
|
|
61
60
|
apply(config, env) {
|
|
62
61
|
if (!env.ssrBuild) {
|
|
63
62
|
return true;
|
|
@@ -75,6 +74,8 @@ const UseSeoMetaTransform = unplugin.createUnplugin(() => {
|
|
|
75
74
|
transformInclude(id) {
|
|
76
75
|
const { pathname, search } = ufo.parseURL(decodeURIComponent(node_url.pathToFileURL(id).href));
|
|
77
76
|
const { type } = ufo.parseQuery(search);
|
|
77
|
+
if (pathname.includes("node_modules"))
|
|
78
|
+
return false;
|
|
78
79
|
if (pathname.endsWith(".vue") && (type === "script" || !search))
|
|
79
80
|
return true;
|
|
80
81
|
if (pathname.match(/\.((c|m)?j|t)sx?$/g))
|
|
@@ -129,7 +130,7 @@ const UseSeoMetaTransform = unplugin.createUnplugin(() => {
|
|
|
129
130
|
}
|
|
130
131
|
if (calleeName === "useServerSeoMeta") {
|
|
131
132
|
if (output.length)
|
|
132
|
-
output.push("})");
|
|
133
|
+
output.push("});");
|
|
133
134
|
output.push("useServerHead({", " meta: [");
|
|
134
135
|
} else if (calleeName === "useSeoMeta") {
|
|
135
136
|
output.push(" meta: [");
|
|
@@ -170,7 +171,7 @@ const UseSeoMetaTransform = unplugin.createUnplugin(() => {
|
|
|
170
171
|
if (output) {
|
|
171
172
|
if (meta.length)
|
|
172
173
|
output.push(" ]");
|
|
173
|
-
output.push("})");
|
|
174
|
+
output.push("});");
|
|
174
175
|
s.overwrite(node.start, node.end, output.join("\n"));
|
|
175
176
|
}
|
|
176
177
|
}
|
|
@@ -21,6 +21,8 @@ const TreeshakeServerComposables = createUnplugin(() => {
|
|
|
21
21
|
transformInclude(id) {
|
|
22
22
|
const { pathname, search } = parseURL(decodeURIComponent(pathToFileURL(id).href));
|
|
23
23
|
const { type } = parseQuery(search);
|
|
24
|
+
if (pathname.includes("node_modules"))
|
|
25
|
+
return false;
|
|
24
26
|
if (pathname.endsWith(".vue") && (type === "script" || !search))
|
|
25
27
|
return true;
|
|
26
28
|
if (pathname.match(/\.((c|m)?j|t)sx?$/g))
|
|
@@ -53,9 +55,6 @@ const TreeshakeServerComposables = createUnplugin(() => {
|
|
|
53
55
|
;
|
|
54
56
|
},
|
|
55
57
|
vite: {
|
|
56
|
-
async config(config) {
|
|
57
|
-
root = root || config.root || process.cwd();
|
|
58
|
-
},
|
|
59
58
|
apply(config, env) {
|
|
60
59
|
if (!env.ssrBuild) {
|
|
61
60
|
return true;
|
|
@@ -73,6 +72,8 @@ const UseSeoMetaTransform = createUnplugin(() => {
|
|
|
73
72
|
transformInclude(id) {
|
|
74
73
|
const { pathname, search } = parseURL(decodeURIComponent(pathToFileURL(id).href));
|
|
75
74
|
const { type } = parseQuery(search);
|
|
75
|
+
if (pathname.includes("node_modules"))
|
|
76
|
+
return false;
|
|
76
77
|
if (pathname.endsWith(".vue") && (type === "script" || !search))
|
|
77
78
|
return true;
|
|
78
79
|
if (pathname.match(/\.((c|m)?j|t)sx?$/g))
|
|
@@ -127,7 +128,7 @@ const UseSeoMetaTransform = createUnplugin(() => {
|
|
|
127
128
|
}
|
|
128
129
|
if (calleeName === "useServerSeoMeta") {
|
|
129
130
|
if (output.length)
|
|
130
|
-
output.push("})");
|
|
131
|
+
output.push("});");
|
|
131
132
|
output.push("useServerHead({", " meta: [");
|
|
132
133
|
} else if (calleeName === "useSeoMeta") {
|
|
133
134
|
output.push(" meta: [");
|
|
@@ -168,7 +169,7 @@ const UseSeoMetaTransform = createUnplugin(() => {
|
|
|
168
169
|
if (output) {
|
|
169
170
|
if (meta.length)
|
|
170
171
|
output.push(" ]");
|
|
171
|
-
output.push("})");
|
|
172
|
+
output.push("});");
|
|
172
173
|
s.overwrite(node.start, node.end, output.join("\n"));
|
|
173
174
|
}
|
|
174
175
|
}
|
package/dist/vite.cjs
CHANGED
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.fcdb0ca2.mjs';
|
|
2
2
|
import 'node:url';
|
|
3
3
|
import 'unplugin';
|
|
4
4
|
import 'unplugin-ast';
|
package/dist/webpack.cjs
CHANGED
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.fcdb0ca2.mjs';
|
|
2
2
|
import 'node:url';
|
|
3
3
|
import 'unplugin';
|
|
4
4
|
import 'unplugin-ast';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/addons",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"packageManager": "pnpm@7.27.1",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"ufo": "^1.1.0",
|
|
58
58
|
"unplugin": "^1.1.0",
|
|
59
59
|
"unplugin-ast": "^0.7.0",
|
|
60
|
-
"@unhead/schema": "1.1.
|
|
61
|
-
"@unhead/shared": "1.1.
|
|
62
|
-
"unhead": "1.1.
|
|
60
|
+
"@unhead/schema": "1.1.2",
|
|
61
|
+
"@unhead/shared": "1.1.2",
|
|
62
|
+
"unhead": "1.1.2"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@babel/types": "^7.21.0"
|