unplugin-kubb 3.2.1 → 4.0.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/astro.cjs +1 -1
- package/dist/astro.d.cts +1 -1
- package/dist/astro.d.ts +1 -1
- package/dist/astro.js +1 -1
- package/dist/esbuild.cjs +1 -1
- package/dist/esbuild.d.cts +1 -1
- package/dist/esbuild.d.ts +1 -1
- package/dist/esbuild.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/nuxt.cjs +3 -3
- package/dist/nuxt.d.cts +1 -1
- package/dist/nuxt.d.ts +1 -1
- package/dist/nuxt.js +2 -3
- package/dist/nuxt.js.map +1 -1
- package/dist/rollup.cjs +1 -1
- package/dist/rollup.d.cts +1 -1
- package/dist/rollup.d.ts +1 -1
- package/dist/rollup.js +1 -1
- package/dist/rspack.cjs +1 -1
- package/dist/rspack.d.cts +1 -1
- package/dist/rspack.d.ts +1 -1
- package/dist/rspack.js +1 -1
- package/dist/src-7pFd4t48.cjs +145 -0
- package/dist/src-7pFd4t48.cjs.map +1 -0
- package/dist/src-y2za6sAo.js +94 -0
- package/dist/src-y2za6sAo.js.map +1 -0
- package/dist/{types-BNmRHGEx.d.cts → types-BWfxOttU.d.ts} +231 -80
- package/dist/{types-D54bCl1u.d.ts → types-BgPPdoLi.d.cts} +231 -80
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/{vite-CZqCD2RF.js → vite-DXcgbm9H.js} +2 -2
- package/dist/{vite-CZqCD2RF.js.map → vite-DXcgbm9H.js.map} +1 -1
- package/dist/{vite-DO7vdmOO.cjs → vite-HDFFF5rj.cjs} +2 -2
- package/dist/{vite-DO7vdmOO.cjs.map → vite-HDFFF5rj.cjs.map} +1 -1
- package/dist/vite.cjs +1 -2
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +1 -2
- package/dist/{webpack-BPXrZfNl.js → webpack-BqG9Y2kv.js} +2 -2
- package/dist/{webpack-BPXrZfNl.js.map → webpack-BqG9Y2kv.js.map} +1 -1
- package/dist/{webpack-DwzhnPfl.cjs → webpack-D1dzppyE.cjs} +2 -2
- package/dist/{webpack-DwzhnPfl.cjs.map → webpack-D1dzppyE.cjs.map} +1 -1
- package/dist/webpack.cjs +1 -2
- package/dist/webpack.d.cts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +1 -2
- package/package.json +26 -26
- package/src/index.ts +117 -47
- package/dist/chunk-Bwj0kw0m.js +0 -32
- package/dist/src-6M-KdHiM.cjs +0 -67
- package/dist/src-6M-KdHiM.cjs.map +0 -1
- package/dist/src-CN9jIyH0.js +0 -50
- package/dist/src-CN9jIyH0.js.map +0 -1
package/src/index.ts
CHANGED
|
@@ -1,64 +1,134 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { safeBuild } from '@kubb/core'
|
|
3
|
-
import {
|
|
1
|
+
import process from 'node:process'
|
|
2
|
+
import { type Config, type KubbEvents, safeBuild } from '@kubb/core'
|
|
3
|
+
import { AsyncEventEmitter } from '@kubb/core/utils'
|
|
4
4
|
import type { UnpluginFactory } from 'unplugin'
|
|
5
5
|
import { createUnplugin } from 'unplugin'
|
|
6
|
+
import { version as unpluginVersion } from '../package.json'
|
|
6
7
|
import type { Options } from './types.ts'
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
type RollupContext = {
|
|
10
|
+
info?: (message: string) => void
|
|
11
|
+
warn?: (message: string) => void
|
|
12
|
+
error?: (message: string) => void
|
|
13
|
+
}
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
logger.on('start', (message: string) => {
|
|
20
|
-
config.logger.info(`${name}: ${message}`)
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
logger.on('success', (message: string) => {
|
|
24
|
-
config.logger.info(`${name}: ${message}`)
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
logger.on('warning', (message: string) => {
|
|
28
|
-
config.logger.info(`${name}: ${message}`)
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
logger.on('error', (message: string) => {
|
|
32
|
-
config.logger.info(`${name}: ${message}`)
|
|
33
|
-
})
|
|
34
|
-
},
|
|
35
|
-
},
|
|
15
|
+
export const unpluginFactory: UnpluginFactory<Options | undefined> = (options, meta) => {
|
|
16
|
+
const name = 'unplugin-kubb' as const
|
|
17
|
+
const events = new AsyncEventEmitter<KubbEvents>()
|
|
18
|
+
const isVite = meta.framework === 'vite'
|
|
19
|
+
const hrStart = process.hrtime()
|
|
36
20
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
21
|
+
async function runBuild(ctx: RollupContext) {
|
|
22
|
+
if (!options?.config) {
|
|
23
|
+
if (ctx.error) {
|
|
24
|
+
ctx.error?.(`[${name}] Config is not set`)
|
|
25
|
+
} else {
|
|
26
|
+
console.error(`[${name}] Config is not set`)
|
|
40
27
|
}
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
events.on('lifecycle:start', (version) => {
|
|
32
|
+
console.log(`Kubb Unplugin ${version} 🧩`)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
events.on('error', (error) => {
|
|
36
|
+
console.error(`✗ ${error?.message || 'failed'}`)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
events.on('warn', (message) => {
|
|
40
|
+
console.warn(`⚠ ${message}`)
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
events.on('info', (message) => {
|
|
44
|
+
console.info(`ℹ ${message}`)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
events.on('success', (message) => {
|
|
48
|
+
console.log(`✓ ${message}`)
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
events.on('plugin:end', (plugin, duration) => {
|
|
52
|
+
const durationStr = duration >= 1000 ? `${(duration / 1000).toFixed(2)}s` : `${duration}ms`
|
|
53
|
+
|
|
54
|
+
console.log(`✓ ${plugin.name} completed in ${durationStr}`)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
events.on('files:processing:end', () => {
|
|
58
|
+
const text = '✓ Files written successfully'
|
|
41
59
|
|
|
42
|
-
|
|
60
|
+
console.log(text)
|
|
61
|
+
})
|
|
43
62
|
|
|
44
|
-
|
|
63
|
+
events.on('generation:end', (config) => {
|
|
64
|
+
console.log(config.name ? `✓ Generation completed for ${config.name}` : '✓ Generation completed')
|
|
65
|
+
})
|
|
45
66
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
67
|
+
events.on('generation:summary', (config, { status, failedPlugins }) => {
|
|
68
|
+
const pluginsCount = config.plugins?.length || 0
|
|
69
|
+
const successCount = pluginsCount - failedPlugins.size
|
|
70
|
+
|
|
71
|
+
console.log(
|
|
72
|
+
status === 'success'
|
|
73
|
+
? `Kubb Summary: ✓ ${`${successCount} successful`}, ${pluginsCount} total`
|
|
74
|
+
: `Kubb Summary: ✓ ${`${successCount} successful`}, ✗ ${`${failedPlugins.size} failed`}, ${pluginsCount} total`,
|
|
75
|
+
)
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
await events.emit('lifecycle:start', unpluginVersion)
|
|
79
|
+
|
|
80
|
+
const { root: _root, ...userConfig } = options.config as Config
|
|
81
|
+
|
|
82
|
+
await events.emit('generation:start', options.config as Config)
|
|
83
|
+
|
|
84
|
+
const { error, failedPlugins, pluginTimings, files } = await safeBuild({
|
|
85
|
+
config: {
|
|
86
|
+
root: process.cwd(),
|
|
87
|
+
...userConfig,
|
|
88
|
+
output: {
|
|
89
|
+
write: true,
|
|
90
|
+
...userConfig.output,
|
|
54
91
|
},
|
|
55
|
-
|
|
92
|
+
},
|
|
93
|
+
events,
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
const hasFailures = failedPlugins.size > 0 || error
|
|
97
|
+
if (hasFailures) {
|
|
98
|
+
// Collect all errors from failed plugins and general error
|
|
99
|
+
const allErrors: Error[] = [
|
|
100
|
+
error,
|
|
101
|
+
...Array.from(failedPlugins)
|
|
102
|
+
.filter((it) => it.error)
|
|
103
|
+
.map((it) => it.error),
|
|
104
|
+
].filter(Boolean)
|
|
105
|
+
|
|
106
|
+
allErrors.forEach((err) => {
|
|
107
|
+
events.emit('error', err)
|
|
56
108
|
})
|
|
109
|
+
}
|
|
57
110
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
111
|
+
await events.emit('generation:end', options.config as Config)
|
|
112
|
+
await events.emit('generation:summary', options.config as Config, {
|
|
113
|
+
failedPlugins,
|
|
114
|
+
filesCreated: files.length,
|
|
115
|
+
status: failedPlugins.size > 0 || error ? 'failed' : 'success',
|
|
116
|
+
hrStart,
|
|
117
|
+
pluginTimings,
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
await events.emit('lifecycle:end')
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
name,
|
|
125
|
+
enforce: 'pre',
|
|
126
|
+
apply: isVite ? 'build' : undefined,
|
|
127
|
+
async buildStart() {
|
|
128
|
+
await runBuild(this as unknown as RollupContext)
|
|
61
129
|
},
|
|
130
|
+
|
|
131
|
+
vite: {},
|
|
62
132
|
}
|
|
63
133
|
}
|
|
64
134
|
|
package/dist/chunk-Bwj0kw0m.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
|
|
3
|
-
//#region rolldown:runtime
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
13
|
-
key = keys[i];
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
15
|
-
__defProp(to, key, {
|
|
16
|
-
get: ((k) => from[k]).bind(null, key),
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
-
value: mod,
|
|
26
|
-
enumerable: true
|
|
27
|
-
}) : target, mod));
|
|
28
|
-
var __toDynamicImportESM = (isNodeMode) => (mod) => __toESM(mod.default, isNodeMode);
|
|
29
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
export { };
|
package/dist/src-6M-KdHiM.cjs
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
let __kubb_core = require("@kubb/core");
|
|
2
|
-
let __kubb_core_logger = require("@kubb/core/logger");
|
|
3
|
-
let unplugin = require("unplugin");
|
|
4
|
-
|
|
5
|
-
//#region src/index.ts
|
|
6
|
-
const unpluginFactory = (options) => {
|
|
7
|
-
const name = "unplugin-kubb";
|
|
8
|
-
const logger = (0, __kubb_core_logger.createLogger)({ name });
|
|
9
|
-
return {
|
|
10
|
-
name,
|
|
11
|
-
enforce: "pre",
|
|
12
|
-
vite: { configResolved(config) {
|
|
13
|
-
logger.on("start", (message) => {
|
|
14
|
-
config.logger.info(`${name}: ${message}`);
|
|
15
|
-
});
|
|
16
|
-
logger.on("success", (message) => {
|
|
17
|
-
config.logger.info(`${name}: ${message}`);
|
|
18
|
-
});
|
|
19
|
-
logger.on("warning", (message) => {
|
|
20
|
-
config.logger.info(`${name}: ${message}`);
|
|
21
|
-
});
|
|
22
|
-
logger.on("error", (message) => {
|
|
23
|
-
config.logger.info(`${name}: ${message}`);
|
|
24
|
-
});
|
|
25
|
-
} },
|
|
26
|
-
async install() {
|
|
27
|
-
if (!options?.config) throw new Error("Config is not set");
|
|
28
|
-
const { root: _root, ...userConfig } = options.config;
|
|
29
|
-
logger.emit("start", "Building");
|
|
30
|
-
const { error } = await (0, __kubb_core.safeBuild)({
|
|
31
|
-
config: {
|
|
32
|
-
root: process.cwd(),
|
|
33
|
-
...userConfig,
|
|
34
|
-
output: {
|
|
35
|
-
write: true,
|
|
36
|
-
...userConfig.output
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
logger
|
|
40
|
-
});
|
|
41
|
-
if (error) throw error;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
const unplugin$1 = /* @__PURE__ */ (0, unplugin.createUnplugin)(unpluginFactory);
|
|
46
|
-
var src_default = unplugin$1;
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
Object.defineProperty(exports, 'src_default', {
|
|
50
|
-
enumerable: true,
|
|
51
|
-
get: function () {
|
|
52
|
-
return src_default;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
Object.defineProperty(exports, 'unplugin', {
|
|
56
|
-
enumerable: true,
|
|
57
|
-
get: function () {
|
|
58
|
-
return unplugin$1;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
Object.defineProperty(exports, 'unpluginFactory', {
|
|
62
|
-
enumerable: true,
|
|
63
|
-
get: function () {
|
|
64
|
-
return unpluginFactory;
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
//# sourceMappingURL=src-6M-KdHiM.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"src-6M-KdHiM.cjs","names":["unpluginFactory: UnpluginFactory<Options | undefined>","unplugin"],"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from '@kubb/core'\nimport { safeBuild } from '@kubb/core'\nimport { createLogger } from '@kubb/core/logger'\nimport type { UnpluginFactory } from 'unplugin'\nimport { createUnplugin } from 'unplugin'\nimport type { Options } from './types.ts'\n\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (options) => {\n const name = 'unplugin-kubb' as const\n const logger = createLogger({\n name,\n })\n\n return {\n name,\n enforce: 'pre',\n vite: {\n configResolved(config) {\n logger.on('start', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n\n logger.on('success', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n\n logger.on('warning', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n\n logger.on('error', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n },\n },\n\n async install() {\n if (!options?.config) {\n throw new Error('Config is not set')\n }\n\n const { root: _root, ...userConfig } = options.config as Config\n\n logger.emit('start', 'Building')\n\n const { error } = await safeBuild({\n config: {\n root: process.cwd(),\n ...userConfig,\n output: {\n write: true,\n ...userConfig.output,\n },\n },\n logger,\n })\n\n if (error) {\n throw error\n }\n },\n }\n}\n\nexport const unplugin = /* #__PURE__ */ createUnplugin(unpluginFactory)\n\nexport default unplugin\n"],"mappings":";;;;;AAOA,MAAaA,mBAAyD,YAAY;CAChF,MAAM,OAAO;CACb,MAAM,8CAAsB,EAC1B,MACD,CAAC;AAEF,QAAO;EACL;EACA,SAAS;EACT,MAAM,EACJ,eAAe,QAAQ;AACrB,UAAO,GAAG,UAAU,YAAoB;AACtC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;AAEF,UAAO,GAAG,YAAY,YAAoB;AACxC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;AAEF,UAAO,GAAG,YAAY,YAAoB;AACxC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;AAEF,UAAO,GAAG,UAAU,YAAoB;AACtC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;KAEL;EAED,MAAM,UAAU;AACd,OAAI,CAAC,SAAS,OACZ,OAAM,IAAI,MAAM,oBAAoB;GAGtC,MAAM,EAAE,MAAM,OAAO,GAAG,eAAe,QAAQ;AAE/C,UAAO,KAAK,SAAS,WAAW;GAEhC,MAAM,EAAE,UAAU,iCAAgB;IAChC,QAAQ;KACN,MAAM,QAAQ,KAAK;KACnB,GAAG;KACH,QAAQ;MACN,OAAO;MACP,GAAG,WAAW;MACf;KACF;IACD;IACD,CAAC;AAEF,OAAI,MACF,OAAM;;EAGX;;AAGH,MAAaC,aAA2B,6CAAe,gBAAgB;AAEvE,kBAAeA"}
|
package/dist/src-CN9jIyH0.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { safeBuild } from "@kubb/core";
|
|
2
|
-
import { createLogger } from "@kubb/core/logger";
|
|
3
|
-
import { createUnplugin } from "unplugin";
|
|
4
|
-
|
|
5
|
-
//#region src/index.ts
|
|
6
|
-
const unpluginFactory = (options) => {
|
|
7
|
-
const name = "unplugin-kubb";
|
|
8
|
-
const logger = createLogger({ name });
|
|
9
|
-
return {
|
|
10
|
-
name,
|
|
11
|
-
enforce: "pre",
|
|
12
|
-
vite: { configResolved(config) {
|
|
13
|
-
logger.on("start", (message) => {
|
|
14
|
-
config.logger.info(`${name}: ${message}`);
|
|
15
|
-
});
|
|
16
|
-
logger.on("success", (message) => {
|
|
17
|
-
config.logger.info(`${name}: ${message}`);
|
|
18
|
-
});
|
|
19
|
-
logger.on("warning", (message) => {
|
|
20
|
-
config.logger.info(`${name}: ${message}`);
|
|
21
|
-
});
|
|
22
|
-
logger.on("error", (message) => {
|
|
23
|
-
config.logger.info(`${name}: ${message}`);
|
|
24
|
-
});
|
|
25
|
-
} },
|
|
26
|
-
async install() {
|
|
27
|
-
if (!options?.config) throw new Error("Config is not set");
|
|
28
|
-
const { root: _root, ...userConfig } = options.config;
|
|
29
|
-
logger.emit("start", "Building");
|
|
30
|
-
const { error } = await safeBuild({
|
|
31
|
-
config: {
|
|
32
|
-
root: process.cwd(),
|
|
33
|
-
...userConfig,
|
|
34
|
-
output: {
|
|
35
|
-
write: true,
|
|
36
|
-
...userConfig.output
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
logger
|
|
40
|
-
});
|
|
41
|
-
if (error) throw error;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
const unplugin = /* @__PURE__ */ createUnplugin(unpluginFactory);
|
|
46
|
-
var src_default = unplugin;
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
export { unplugin as n, unpluginFactory as r, src_default as t };
|
|
50
|
-
//# sourceMappingURL=src-CN9jIyH0.js.map
|
package/dist/src-CN9jIyH0.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"src-CN9jIyH0.js","names":["unpluginFactory: UnpluginFactory<Options | undefined>"],"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from '@kubb/core'\nimport { safeBuild } from '@kubb/core'\nimport { createLogger } from '@kubb/core/logger'\nimport type { UnpluginFactory } from 'unplugin'\nimport { createUnplugin } from 'unplugin'\nimport type { Options } from './types.ts'\n\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (options) => {\n const name = 'unplugin-kubb' as const\n const logger = createLogger({\n name,\n })\n\n return {\n name,\n enforce: 'pre',\n vite: {\n configResolved(config) {\n logger.on('start', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n\n logger.on('success', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n\n logger.on('warning', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n\n logger.on('error', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n },\n },\n\n async install() {\n if (!options?.config) {\n throw new Error('Config is not set')\n }\n\n const { root: _root, ...userConfig } = options.config as Config\n\n logger.emit('start', 'Building')\n\n const { error } = await safeBuild({\n config: {\n root: process.cwd(),\n ...userConfig,\n output: {\n write: true,\n ...userConfig.output,\n },\n },\n logger,\n })\n\n if (error) {\n throw error\n }\n },\n }\n}\n\nexport const unplugin = /* #__PURE__ */ createUnplugin(unpluginFactory)\n\nexport default unplugin\n"],"mappings":";;;;;AAOA,MAAaA,mBAAyD,YAAY;CAChF,MAAM,OAAO;CACb,MAAM,SAAS,aAAa,EAC1B,MACD,CAAC;AAEF,QAAO;EACL;EACA,SAAS;EACT,MAAM,EACJ,eAAe,QAAQ;AACrB,UAAO,GAAG,UAAU,YAAoB;AACtC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;AAEF,UAAO,GAAG,YAAY,YAAoB;AACxC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;AAEF,UAAO,GAAG,YAAY,YAAoB;AACxC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;AAEF,UAAO,GAAG,UAAU,YAAoB;AACtC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;KAEL;EAED,MAAM,UAAU;AACd,OAAI,CAAC,SAAS,OACZ,OAAM,IAAI,MAAM,oBAAoB;GAGtC,MAAM,EAAE,MAAM,OAAO,GAAG,eAAe,QAAQ;AAE/C,UAAO,KAAK,SAAS,WAAW;GAEhC,MAAM,EAAE,UAAU,MAAM,UAAU;IAChC,QAAQ;KACN,MAAM,QAAQ,KAAK;KACnB,GAAG;KACH,QAAQ;MACN,OAAO;MACP,GAAG,WAAW;MACf;KACF;IACD;IACD,CAAC;AAEF,OAAI,MACF,OAAM;;EAGX;;AAGH,MAAa,WAA2B,+BAAe,gBAAgB;AAEvE,kBAAe"}
|