@unhead/addons 1.1.11 → 1.1.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.
- package/dist/UseSeoMetaTransform-f7637bc6.d.ts +17 -0
- package/dist/shared/{addons.0de86982.mjs → addons.0ba23e37.mjs} +40 -20
- package/dist/shared/{addons.a42db7c8.cjs → addons.4e843ef1.cjs} +40 -20
- package/dist/vite.cjs +4 -4
- package/dist/vite.d.ts +5 -1
- package/dist/vite.mjs +4 -4
- package/dist/webpack.cjs +4 -4
- package/dist/webpack.d.ts +5 -1
- package/dist/webpack.mjs +4 -4
- package/package.json +5 -5
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface BaseTransformerTypes {
|
|
2
|
+
sourcemap?: boolean;
|
|
3
|
+
filter?: {
|
|
4
|
+
exclude?: RegExp[];
|
|
5
|
+
include?: RegExp[];
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface TreeshakeServerComposablesOptions extends BaseTransformerTypes {
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface UseSeoMetaTransformOptions extends BaseTransformerTypes {
|
|
14
|
+
imports?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { BaseTransformerTypes as B, TreeshakeServerComposablesOptions as T, UseSeoMetaTransformOptions as U };
|
|
@@ -13,17 +13,21 @@ const RemoveFunctions = (functionNames) => ({
|
|
|
13
13
|
return false;
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
const TreeshakeServerComposables = createUnplugin(() => {
|
|
17
|
-
|
|
16
|
+
const TreeshakeServerComposables = createUnplugin((options = {}) => {
|
|
17
|
+
options.enabled = typeof options.enabled !== "undefined" ? options.enabled : true;
|
|
18
18
|
return {
|
|
19
19
|
name: "unhead:remove-server-composables",
|
|
20
20
|
enforce: "post",
|
|
21
21
|
transformInclude(id) {
|
|
22
|
-
if (!enabled)
|
|
22
|
+
if (!options.enabled)
|
|
23
23
|
return false;
|
|
24
24
|
const { pathname, search } = parseURL(decodeURIComponent(pathToFileURL(id).href));
|
|
25
25
|
const { type } = parseQuery(search);
|
|
26
|
-
if (pathname.
|
|
26
|
+
if (pathname.match(/[\\/]node_modules[\\/]/))
|
|
27
|
+
return false;
|
|
28
|
+
if (options.filter?.include?.some((pattern) => id.match(pattern)))
|
|
29
|
+
return true;
|
|
30
|
+
if (options.filter?.exclude?.some((pattern) => id.match(pattern)))
|
|
27
31
|
return false;
|
|
28
32
|
if (pathname.endsWith(".vue") && (type === "script" || !search))
|
|
29
33
|
return true;
|
|
@@ -54,12 +58,12 @@ const TreeshakeServerComposables = createUnplugin(() => {
|
|
|
54
58
|
},
|
|
55
59
|
webpack(ctx) {
|
|
56
60
|
if (ctx.name === "server")
|
|
57
|
-
enabled = false;
|
|
61
|
+
options.enabled = false;
|
|
58
62
|
},
|
|
59
63
|
vite: {
|
|
60
64
|
apply(config, env) {
|
|
61
65
|
if (env.ssrBuild) {
|
|
62
|
-
enabled = false;
|
|
66
|
+
options.enabled = false;
|
|
63
67
|
return true;
|
|
64
68
|
}
|
|
65
69
|
return false;
|
|
@@ -300,14 +304,19 @@ function walk(ast, { enter, leave }) {
|
|
|
300
304
|
return instance.visit(ast, null);
|
|
301
305
|
}
|
|
302
306
|
|
|
303
|
-
const UseSeoMetaTransform = createUnplugin(() => {
|
|
307
|
+
const UseSeoMetaTransform = createUnplugin((options = {}) => {
|
|
308
|
+
options.imports = options.imports || true;
|
|
304
309
|
return {
|
|
305
310
|
name: "unhead:use-seo-meta-transform",
|
|
306
311
|
enforce: "post",
|
|
307
312
|
transformInclude(id) {
|
|
308
313
|
const { pathname, search } = parseURL(decodeURIComponent(pathToFileURL(id).href));
|
|
309
314
|
const { type } = parseQuery(search);
|
|
310
|
-
if (pathname.
|
|
315
|
+
if (pathname.match(/[\\/]node_modules[\\/]/))
|
|
316
|
+
return false;
|
|
317
|
+
if (options.filter?.include?.some((pattern) => id.match(pattern)))
|
|
318
|
+
return true;
|
|
319
|
+
if (options.filter?.exclude?.some((pattern) => id.match(pattern)))
|
|
311
320
|
return false;
|
|
312
321
|
if (pathname.endsWith(".vue") && (type === "script" || !search))
|
|
313
322
|
return true;
|
|
@@ -332,14 +341,18 @@ const UseSeoMetaTransform = createUnplugin(() => {
|
|
|
332
341
|
const extraImports = /* @__PURE__ */ new Set();
|
|
333
342
|
walk(ast, {
|
|
334
343
|
enter(_node) {
|
|
335
|
-
if (_node.type === "ImportDeclaration" && packages.includes(_node.source.value)) {
|
|
336
|
-
|
|
344
|
+
if (options.imports && _node.type === "ImportDeclaration" && packages.includes(_node.source.value)) {
|
|
345
|
+
const node = _node;
|
|
346
|
+
if (
|
|
347
|
+
// @ts-expect-error untyped
|
|
348
|
+
!node.specifiers.some((s2) => s2.type === "ImportSpecifier" && ["useSeoMeta", "useServerSeoMeta"].includes(s2.imported?.name))
|
|
349
|
+
)
|
|
337
350
|
return;
|
|
338
351
|
const imports = Object.values(importNames);
|
|
339
352
|
if (!imports.includes("useHead"))
|
|
340
|
-
extraImports.add(`import { useHead } from '${
|
|
353
|
+
extraImports.add(`import { useHead } from '${node.source.value}'`);
|
|
341
354
|
if (!imports.includes("useServerHead") && imports.includes("useServerSeoMeta"))
|
|
342
|
-
extraImports.add(`import { useServerHead } from '${
|
|
355
|
+
extraImports.add(`import { useServerHead } from '${node.source.value}'`);
|
|
343
356
|
} else if (_node.type === "CallExpression" && _node.callee.type === "Identifier" && Object.keys({
|
|
344
357
|
useSeoMeta: "useSeoMeta",
|
|
345
358
|
useServerSeoMeta: "useServerSeoMeta",
|
|
@@ -351,15 +364,17 @@ const UseSeoMetaTransform = createUnplugin(() => {
|
|
|
351
364
|
if (!properties)
|
|
352
365
|
return;
|
|
353
366
|
let output = [];
|
|
354
|
-
const title = properties.find((property) => property.key
|
|
355
|
-
const titleTemplate = properties.find((property) => property.key
|
|
356
|
-
const meta = properties.filter((property) => property.key
|
|
367
|
+
const title = properties.find((property) => property.key?.name === "title");
|
|
368
|
+
const titleTemplate = properties.find((property) => property.key?.name === "titleTemplate");
|
|
369
|
+
const meta = properties.filter((property) => property.key?.name !== "title" && property.key?.name !== "titleTemplate");
|
|
357
370
|
if (title || titleTemplate || calleeName === "useSeoMeta") {
|
|
358
371
|
output.push("useHead({");
|
|
359
|
-
if (title)
|
|
372
|
+
if (title) {
|
|
360
373
|
output.push(` title: ${code.substring(title.value.start, title.value.end)},`);
|
|
361
|
-
|
|
374
|
+
}
|
|
375
|
+
if (titleTemplate) {
|
|
362
376
|
output.push(` titleTemplate: ${code.substring(titleTemplate.value.start, titleTemplate.value.end)},`);
|
|
377
|
+
}
|
|
363
378
|
}
|
|
364
379
|
if (calleeName === "useServerSeoMeta") {
|
|
365
380
|
if (output.length)
|
|
@@ -369,17 +384,22 @@ const UseSeoMetaTransform = createUnplugin(() => {
|
|
|
369
384
|
if (meta.length)
|
|
370
385
|
output.push(" meta: [");
|
|
371
386
|
meta.forEach((property) => {
|
|
387
|
+
if (property.key.type !== "Identifier" || !property.value) {
|
|
388
|
+
output = false;
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
372
391
|
if (output === false)
|
|
373
392
|
return;
|
|
374
|
-
const
|
|
375
|
-
const
|
|
393
|
+
const propertyKey = property.key;
|
|
394
|
+
const key = resolveMetaKeyType(propertyKey.name);
|
|
395
|
+
const keyValue = resolveMetaKeyValue(propertyKey.name);
|
|
376
396
|
const valueKey = key === "charset" ? "charset" : "content";
|
|
377
397
|
let value = code.substring(property.value.start, property.value.end);
|
|
378
398
|
if (property.value.type === "ArrayExpression") {
|
|
379
399
|
output = false;
|
|
380
400
|
return;
|
|
381
401
|
} else if (property.value.type === "ObjectExpression") {
|
|
382
|
-
const isStatic = property.value.properties.every((
|
|
402
|
+
const isStatic = property.value.properties.every((p) => p.value.type === "Literal" && typeof p.value.value === "string");
|
|
383
403
|
if (!isStatic) {
|
|
384
404
|
output = false;
|
|
385
405
|
return;
|
|
@@ -15,17 +15,21 @@ const RemoveFunctions = (functionNames) => ({
|
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
const TreeshakeServerComposables = unplugin.createUnplugin(() => {
|
|
19
|
-
|
|
18
|
+
const TreeshakeServerComposables = unplugin.createUnplugin((options = {}) => {
|
|
19
|
+
options.enabled = typeof options.enabled !== "undefined" ? options.enabled : true;
|
|
20
20
|
return {
|
|
21
21
|
name: "unhead:remove-server-composables",
|
|
22
22
|
enforce: "post",
|
|
23
23
|
transformInclude(id) {
|
|
24
|
-
if (!enabled)
|
|
24
|
+
if (!options.enabled)
|
|
25
25
|
return false;
|
|
26
26
|
const { pathname, search } = ufo.parseURL(decodeURIComponent(node_url.pathToFileURL(id).href));
|
|
27
27
|
const { type } = ufo.parseQuery(search);
|
|
28
|
-
if (pathname.
|
|
28
|
+
if (pathname.match(/[\\/]node_modules[\\/]/))
|
|
29
|
+
return false;
|
|
30
|
+
if (options.filter?.include?.some((pattern) => id.match(pattern)))
|
|
31
|
+
return true;
|
|
32
|
+
if (options.filter?.exclude?.some((pattern) => id.match(pattern)))
|
|
29
33
|
return false;
|
|
30
34
|
if (pathname.endsWith(".vue") && (type === "script" || !search))
|
|
31
35
|
return true;
|
|
@@ -56,12 +60,12 @@ const TreeshakeServerComposables = unplugin.createUnplugin(() => {
|
|
|
56
60
|
},
|
|
57
61
|
webpack(ctx) {
|
|
58
62
|
if (ctx.name === "server")
|
|
59
|
-
enabled = false;
|
|
63
|
+
options.enabled = false;
|
|
60
64
|
},
|
|
61
65
|
vite: {
|
|
62
66
|
apply(config, env) {
|
|
63
67
|
if (env.ssrBuild) {
|
|
64
|
-
enabled = false;
|
|
68
|
+
options.enabled = false;
|
|
65
69
|
return true;
|
|
66
70
|
}
|
|
67
71
|
return false;
|
|
@@ -302,14 +306,19 @@ function walk(ast, { enter, leave }) {
|
|
|
302
306
|
return instance.visit(ast, null);
|
|
303
307
|
}
|
|
304
308
|
|
|
305
|
-
const UseSeoMetaTransform = unplugin.createUnplugin(() => {
|
|
309
|
+
const UseSeoMetaTransform = unplugin.createUnplugin((options = {}) => {
|
|
310
|
+
options.imports = options.imports || true;
|
|
306
311
|
return {
|
|
307
312
|
name: "unhead:use-seo-meta-transform",
|
|
308
313
|
enforce: "post",
|
|
309
314
|
transformInclude(id) {
|
|
310
315
|
const { pathname, search } = ufo.parseURL(decodeURIComponent(node_url.pathToFileURL(id).href));
|
|
311
316
|
const { type } = ufo.parseQuery(search);
|
|
312
|
-
if (pathname.
|
|
317
|
+
if (pathname.match(/[\\/]node_modules[\\/]/))
|
|
318
|
+
return false;
|
|
319
|
+
if (options.filter?.include?.some((pattern) => id.match(pattern)))
|
|
320
|
+
return true;
|
|
321
|
+
if (options.filter?.exclude?.some((pattern) => id.match(pattern)))
|
|
313
322
|
return false;
|
|
314
323
|
if (pathname.endsWith(".vue") && (type === "script" || !search))
|
|
315
324
|
return true;
|
|
@@ -334,14 +343,18 @@ const UseSeoMetaTransform = unplugin.createUnplugin(() => {
|
|
|
334
343
|
const extraImports = /* @__PURE__ */ new Set();
|
|
335
344
|
walk(ast, {
|
|
336
345
|
enter(_node) {
|
|
337
|
-
if (_node.type === "ImportDeclaration" && packages.includes(_node.source.value)) {
|
|
338
|
-
|
|
346
|
+
if (options.imports && _node.type === "ImportDeclaration" && packages.includes(_node.source.value)) {
|
|
347
|
+
const node = _node;
|
|
348
|
+
if (
|
|
349
|
+
// @ts-expect-error untyped
|
|
350
|
+
!node.specifiers.some((s2) => s2.type === "ImportSpecifier" && ["useSeoMeta", "useServerSeoMeta"].includes(s2.imported?.name))
|
|
351
|
+
)
|
|
339
352
|
return;
|
|
340
353
|
const imports = Object.values(importNames);
|
|
341
354
|
if (!imports.includes("useHead"))
|
|
342
|
-
extraImports.add(`import { useHead } from '${
|
|
355
|
+
extraImports.add(`import { useHead } from '${node.source.value}'`);
|
|
343
356
|
if (!imports.includes("useServerHead") && imports.includes("useServerSeoMeta"))
|
|
344
|
-
extraImports.add(`import { useServerHead } from '${
|
|
357
|
+
extraImports.add(`import { useServerHead } from '${node.source.value}'`);
|
|
345
358
|
} else if (_node.type === "CallExpression" && _node.callee.type === "Identifier" && Object.keys({
|
|
346
359
|
useSeoMeta: "useSeoMeta",
|
|
347
360
|
useServerSeoMeta: "useServerSeoMeta",
|
|
@@ -353,15 +366,17 @@ const UseSeoMetaTransform = unplugin.createUnplugin(() => {
|
|
|
353
366
|
if (!properties)
|
|
354
367
|
return;
|
|
355
368
|
let output = [];
|
|
356
|
-
const title = properties.find((property) => property.key
|
|
357
|
-
const titleTemplate = properties.find((property) => property.key
|
|
358
|
-
const meta = properties.filter((property) => property.key
|
|
369
|
+
const title = properties.find((property) => property.key?.name === "title");
|
|
370
|
+
const titleTemplate = properties.find((property) => property.key?.name === "titleTemplate");
|
|
371
|
+
const meta = properties.filter((property) => property.key?.name !== "title" && property.key?.name !== "titleTemplate");
|
|
359
372
|
if (title || titleTemplate || calleeName === "useSeoMeta") {
|
|
360
373
|
output.push("useHead({");
|
|
361
|
-
if (title)
|
|
374
|
+
if (title) {
|
|
362
375
|
output.push(` title: ${code.substring(title.value.start, title.value.end)},`);
|
|
363
|
-
|
|
376
|
+
}
|
|
377
|
+
if (titleTemplate) {
|
|
364
378
|
output.push(` titleTemplate: ${code.substring(titleTemplate.value.start, titleTemplate.value.end)},`);
|
|
379
|
+
}
|
|
365
380
|
}
|
|
366
381
|
if (calleeName === "useServerSeoMeta") {
|
|
367
382
|
if (output.length)
|
|
@@ -371,17 +386,22 @@ const UseSeoMetaTransform = unplugin.createUnplugin(() => {
|
|
|
371
386
|
if (meta.length)
|
|
372
387
|
output.push(" meta: [");
|
|
373
388
|
meta.forEach((property) => {
|
|
389
|
+
if (property.key.type !== "Identifier" || !property.value) {
|
|
390
|
+
output = false;
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
374
393
|
if (output === false)
|
|
375
394
|
return;
|
|
376
|
-
const
|
|
377
|
-
const
|
|
395
|
+
const propertyKey = property.key;
|
|
396
|
+
const key = unhead.resolveMetaKeyType(propertyKey.name);
|
|
397
|
+
const keyValue = unhead.resolveMetaKeyValue(propertyKey.name);
|
|
378
398
|
const valueKey = key === "charset" ? "charset" : "content";
|
|
379
399
|
let value = code.substring(property.value.start, property.value.end);
|
|
380
400
|
if (property.value.type === "ArrayExpression") {
|
|
381
401
|
output = false;
|
|
382
402
|
return;
|
|
383
403
|
} else if (property.value.type === "ObjectExpression") {
|
|
384
|
-
const isStatic = property.value.properties.every((
|
|
404
|
+
const isStatic = property.value.properties.every((p) => p.value.type === "Literal" && typeof p.value.value === "string");
|
|
385
405
|
if (!isStatic) {
|
|
386
406
|
output = false;
|
|
387
407
|
return;
|
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.4e843ef1.cjs');
|
|
4
4
|
require('node:url');
|
|
5
5
|
require('unplugin');
|
|
6
6
|
require('unplugin-ast');
|
|
@@ -10,10 +10,10 @@ require('unhead');
|
|
|
10
10
|
require('magic-string');
|
|
11
11
|
require('mlly');
|
|
12
12
|
|
|
13
|
-
const vite = () => {
|
|
13
|
+
const vite = (options = {}) => {
|
|
14
14
|
return [
|
|
15
|
-
UseSeoMetaTransform.TreeshakeServerComposables.vite(),
|
|
16
|
-
UseSeoMetaTransform.UseSeoMetaTransform.vite()
|
|
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.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
+
import { T as TreeshakeServerComposablesOptions, U as UseSeoMetaTransformOptions, B as BaseTransformerTypes } from './UseSeoMetaTransform-f7637bc6.js';
|
|
2
3
|
|
|
3
|
-
declare const _default: (
|
|
4
|
+
declare const _default: (options?: {
|
|
5
|
+
treeshake?: TreeshakeServerComposablesOptions;
|
|
6
|
+
transformSeoMeta?: UseSeoMetaTransformOptions;
|
|
7
|
+
} & BaseTransformerTypes) => (vite.Plugin | vite.Plugin[])[];
|
|
4
8
|
|
|
5
9
|
export { _default as default };
|
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.0ba23e37.mjs';
|
|
2
2
|
import 'node:url';
|
|
3
3
|
import 'unplugin';
|
|
4
4
|
import 'unplugin-ast';
|
|
@@ -8,10 +8,10 @@ import 'unhead';
|
|
|
8
8
|
import 'magic-string';
|
|
9
9
|
import 'mlly';
|
|
10
10
|
|
|
11
|
-
const vite = () => {
|
|
11
|
+
const vite = (options = {}) => {
|
|
12
12
|
return [
|
|
13
|
-
TreeshakeServerComposables.vite(),
|
|
14
|
-
UseSeoMetaTransform.vite()
|
|
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const UseSeoMetaTransform = require('./shared/addons.
|
|
3
|
+
const UseSeoMetaTransform = require('./shared/addons.4e843ef1.cjs');
|
|
4
4
|
require('node:url');
|
|
5
5
|
require('unplugin');
|
|
6
6
|
require('unplugin-ast');
|
|
@@ -10,10 +10,10 @@ require('unhead');
|
|
|
10
10
|
require('magic-string');
|
|
11
11
|
require('mlly');
|
|
12
12
|
|
|
13
|
-
const webpack = () => {
|
|
13
|
+
const webpack = (options = {}) => {
|
|
14
14
|
return [
|
|
15
|
-
UseSeoMetaTransform.TreeshakeServerComposables.webpack(),
|
|
16
|
-
UseSeoMetaTransform.UseSeoMetaTransform.webpack()
|
|
15
|
+
UseSeoMetaTransform.TreeshakeServerComposables.webpack({ filter: options.filter, sourcemap: options.sourcemap, ...options.treeshake || {} }),
|
|
16
|
+
UseSeoMetaTransform.UseSeoMetaTransform.webpack({ filter: options.filter, sourcemap: options.sourcemap, ...options.transformSeoMeta || {} })
|
|
17
17
|
];
|
|
18
18
|
};
|
|
19
19
|
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import * as webpack from 'webpack';
|
|
2
|
+
import { T as TreeshakeServerComposablesOptions, U as UseSeoMetaTransformOptions, B as BaseTransformerTypes } from './UseSeoMetaTransform-f7637bc6.js';
|
|
2
3
|
|
|
3
|
-
declare const _default: (
|
|
4
|
+
declare const _default: (options?: {
|
|
5
|
+
treeshake?: TreeshakeServerComposablesOptions;
|
|
6
|
+
transformSeoMeta?: UseSeoMetaTransformOptions;
|
|
7
|
+
} & BaseTransformerTypes) => webpack.WebpackPluginInstance[];
|
|
4
8
|
|
|
5
9
|
export { _default as default };
|
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.0ba23e37.mjs';
|
|
2
2
|
import 'node:url';
|
|
3
3
|
import 'unplugin';
|
|
4
4
|
import 'unplugin-ast';
|
|
@@ -8,10 +8,10 @@ import 'unhead';
|
|
|
8
8
|
import 'magic-string';
|
|
9
9
|
import 'mlly';
|
|
10
10
|
|
|
11
|
-
const webpack = () => {
|
|
11
|
+
const webpack = (options = {}) => {
|
|
12
12
|
return [
|
|
13
|
-
TreeshakeServerComposables.webpack(),
|
|
14
|
-
UseSeoMetaTransform.webpack()
|
|
13
|
+
TreeshakeServerComposables.webpack({ filter: options.filter, sourcemap: options.sourcemap, ...options.treeshake || {} }),
|
|
14
|
+
UseSeoMetaTransform.webpack({ filter: options.filter, sourcemap: options.sourcemap, ...options.transformSeoMeta || {} })
|
|
15
15
|
];
|
|
16
16
|
};
|
|
17
17
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/addons",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "1.1.12",
|
|
5
|
+
"packageManager": "pnpm@7.28.0",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"ufo": "^1.1.0",
|
|
57
57
|
"unplugin": "^1.1.0",
|
|
58
58
|
"unplugin-ast": "^0.7.0",
|
|
59
|
-
"@unhead/
|
|
60
|
-
"unhead": "1.1.
|
|
61
|
-
"
|
|
59
|
+
"@unhead/schema": "1.1.12",
|
|
60
|
+
"@unhead/shared": "1.1.12",
|
|
61
|
+
"unhead": "1.1.12"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@babel/types": "^7.21.2",
|