@unhead/addons 1.9.15 → 1.10.0-beta.1
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/dist/index.cjs +5 -1
- package/dist/index.mjs +5 -1
- package/dist/shared/{addons.f35fc4f4.cjs → addons.bc63e434.cjs} +1 -1
- package/dist/shared/{addons.63341a68.mjs → addons.cfb49c79.mjs} +1 -1
- package/dist/vite.cjs +3 -3
- package/dist/vite.mjs +3 -3
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -9,11 +9,15 @@ function InferSeoMetaPlugin(options = {}) {
|
|
|
9
9
|
entries: {
|
|
10
10
|
resolve({ entries }) {
|
|
11
11
|
let titleTemplate = null;
|
|
12
|
+
let lastWeight = 999;
|
|
12
13
|
for (const entry of entries) {
|
|
13
14
|
const inputKey = entry.resolvedInput ? "resolvedInput" : "input";
|
|
14
15
|
const input = entry[inputKey];
|
|
15
|
-
|
|
16
|
+
const weight = (typeof input.titleTemplate === "object" ? input.titleTemplate?.tagPriority : false) || entry.tagPriority || 100;
|
|
17
|
+
if (input.titleTemplate !== void 0 && weight <= lastWeight) {
|
|
16
18
|
titleTemplate = input.titleTemplate;
|
|
19
|
+
lastWeight = weight;
|
|
20
|
+
}
|
|
17
21
|
}
|
|
18
22
|
for (const entry of entries) {
|
|
19
23
|
const inputKey = entry.resolvedInput ? "resolvedInput" : "input";
|
package/dist/index.mjs
CHANGED
|
@@ -7,11 +7,15 @@ function InferSeoMetaPlugin(options = {}) {
|
|
|
7
7
|
entries: {
|
|
8
8
|
resolve({ entries }) {
|
|
9
9
|
let titleTemplate = null;
|
|
10
|
+
let lastWeight = 999;
|
|
10
11
|
for (const entry of entries) {
|
|
11
12
|
const inputKey = entry.resolvedInput ? "resolvedInput" : "input";
|
|
12
13
|
const input = entry[inputKey];
|
|
13
|
-
|
|
14
|
+
const weight = (typeof input.titleTemplate === "object" ? input.titleTemplate?.tagPriority : false) || entry.tagPriority || 100;
|
|
15
|
+
if (input.titleTemplate !== void 0 && weight <= lastWeight) {
|
|
14
16
|
titleTemplate = input.titleTemplate;
|
|
17
|
+
lastWeight = weight;
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
for (const entry of entries) {
|
|
17
21
|
const inputKey = entry.resolvedInput ? "resolvedInput" : "input";
|
|
@@ -22,7 +22,7 @@ function RemoveFunctions(functionNames) {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
const TreeshakeServerComposables = unplugin.createUnplugin((options = {}) => {
|
|
25
|
-
options.enabled =
|
|
25
|
+
options.enabled = options.enabled !== void 0 ? options.enabled : true;
|
|
26
26
|
return {
|
|
27
27
|
name: "unhead:remove-server-composables",
|
|
28
28
|
enforce: "post",
|
|
@@ -16,7 +16,7 @@ function RemoveFunctions(functionNames) {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
const TreeshakeServerComposables = createUnplugin((options = {}) => {
|
|
19
|
-
options.enabled =
|
|
19
|
+
options.enabled = options.enabled !== void 0 ? options.enabled : true;
|
|
20
20
|
return {
|
|
21
21
|
name: "unhead:remove-server-composables",
|
|
22
22
|
enforce: "post",
|
package/dist/vite.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const UseSeoMetaTransform = require('./shared/addons.
|
|
3
|
+
const UseSeoMetaTransform = require('./shared/addons.bc63e434.cjs');
|
|
4
4
|
require('node:url');
|
|
5
5
|
require('unplugin');
|
|
6
6
|
require('unplugin-ast');
|
|
@@ -12,8 +12,8 @@ require('mlly');
|
|
|
12
12
|
|
|
13
13
|
const vite = (options = {}) => {
|
|
14
14
|
return [
|
|
15
|
-
UseSeoMetaTransform.TreeshakeServerComposables.vite({ filter: options.filter, sourcemap: options.sourcemap, ...options.treeshake
|
|
16
|
-
UseSeoMetaTransform.UseSeoMetaTransform.vite({ filter: options.filter, sourcemap: options.sourcemap, ...options.transformSeoMeta
|
|
15
|
+
UseSeoMetaTransform.TreeshakeServerComposables.vite({ filter: options.filter, sourcemap: options.sourcemap, ...options.treeshake }),
|
|
16
|
+
UseSeoMetaTransform.UseSeoMetaTransform.vite({ filter: options.filter, sourcemap: options.sourcemap, ...options.transformSeoMeta })
|
|
17
17
|
];
|
|
18
18
|
};
|
|
19
19
|
|
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.cfb49c79.mjs';
|
|
2
2
|
import 'node:url';
|
|
3
3
|
import 'unplugin';
|
|
4
4
|
import 'unplugin-ast';
|
|
@@ -10,8 +10,8 @@ import 'mlly';
|
|
|
10
10
|
|
|
11
11
|
const vite = (options = {}) => {
|
|
12
12
|
return [
|
|
13
|
-
TreeshakeServerComposables.vite({ filter: options.filter, sourcemap: options.sourcemap, ...options.treeshake
|
|
14
|
-
UseSeoMetaTransform.vite({ filter: options.filter, sourcemap: options.sourcemap, ...options.transformSeoMeta
|
|
13
|
+
TreeshakeServerComposables.vite({ filter: options.filter, sourcemap: options.sourcemap, ...options.treeshake }),
|
|
14
|
+
UseSeoMetaTransform.vite({ filter: options.filter, sourcemap: options.sourcemap, ...options.transformSeoMeta })
|
|
15
15
|
];
|
|
16
16
|
};
|
|
17
17
|
|
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.cfb49c79.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.
|
|
4
|
+
"version": "1.10.0-beta.1",
|
|
5
5
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -50,16 +50,16 @@
|
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@rollup/pluginutils": "^5.1.0",
|
|
53
|
-
"magic-string": "^0.30.
|
|
53
|
+
"magic-string": "^0.30.11",
|
|
54
54
|
"mlly": "^1.7.1",
|
|
55
|
-
"ufo": "^1.5.
|
|
56
|
-
"unplugin": "^1.
|
|
55
|
+
"ufo": "^1.5.4",
|
|
56
|
+
"unplugin": "^1.12.2",
|
|
57
57
|
"unplugin-ast": "^0.10.0",
|
|
58
|
-
"@unhead/
|
|
59
|
-
"@unhead/
|
|
58
|
+
"@unhead/schema": "1.10.0-beta.1",
|
|
59
|
+
"@unhead/shared": "1.10.0-beta.1"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@babel/types": "^7.
|
|
62
|
+
"@babel/types": "^7.25.2",
|
|
63
63
|
"estree-walker": "^3.0.3"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|