@powerlines/plugin-vite 0.14.339 → 0.14.341
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/README.md +14 -16
- package/dist/{build-BnD8f4L9.d.mts → build-CksBpNAL.d.cts} +1 -1
- package/dist/build-CksBpNAL.d.cts.map +1 -0
- package/dist/{build-DVley5x8.d.cts → build-DST9kC_L.d.mts} +1 -1
- package/dist/build-DST9kC_L.d.mts.map +1 -0
- package/dist/helpers/index.cjs +4 -4
- package/dist/helpers/index.d.cts +2 -4
- package/dist/helpers/index.d.mts +2 -5
- package/dist/helpers/index.mjs +2 -3
- package/dist/helpers/resolve-options.cjs +2 -1
- package/dist/helpers/resolve-options.d.cts +1 -1
- package/dist/helpers/resolve-options.d.mts +1 -2
- package/dist/helpers/resolve-options.mjs +68 -2
- package/dist/helpers/resolve-options.mjs.map +1 -0
- package/dist/helpers/unplugin.cjs +11 -2
- package/dist/helpers/unplugin.d.cts +1 -2
- package/dist/helpers/unplugin.d.mts +1 -3
- package/dist/helpers/unplugin.mjs +10 -2
- package/dist/helpers/unplugin.mjs.map +1 -0
- package/dist/index.cjs +7 -8
- package/dist/index.d.cts +4 -6
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +4 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -5
- package/dist/index.mjs.map +1 -1
- package/dist/{plugin-BDnHvJzN.d.mts → plugin-Bh-B80x0.d.cts} +2 -2
- package/dist/plugin-Bh-B80x0.d.cts.map +1 -0
- package/dist/{plugin-BMA81Whw.d.cts → plugin-DE3oU3V6.d.mts} +2 -2
- package/dist/plugin-DE3oU3V6.d.mts.map +1 -0
- package/dist/{resolve-options-D-xqROJb.d.mts → resolve-options-BxqjvL8P.d.mts} +2 -2
- package/dist/resolve-options-BxqjvL8P.d.mts.map +1 -0
- package/dist/{resolve-options-CGWH6O9W.cjs → resolve-options-DZOdIilz.cjs} +11 -11
- package/dist/{resolve-options-PlPrxfl4.d.cts → resolve-options-MOVKz6QN.d.cts} +2 -2
- package/dist/resolve-options-MOVKz6QN.d.cts.map +1 -0
- package/dist/types/_internal.d.cts +1 -2
- package/dist/types/_internal.d.cts.map +1 -1
- package/dist/types/_internal.d.mts +1 -3
- package/dist/types/_internal.d.mts.map +1 -1
- package/dist/types/build.d.cts +1 -1
- package/dist/types/build.d.mts +1 -1
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.mts +2 -3
- package/dist/types/plugin.d.cts +1 -1
- package/dist/types/plugin.d.mts +1 -2
- package/dist/unplugin-Cs_a2k7X.d.mts +8 -0
- package/dist/unplugin-Cs_a2k7X.d.mts.map +1 -0
- package/dist/unplugin-Csj_0MkH.d.cts +8 -0
- package/dist/unplugin-Csj_0MkH.d.cts.map +1 -0
- package/package.json +22 -21
- package/dist/build-BnD8f4L9.d.mts.map +0 -1
- package/dist/build-DJTI0ZMx.cjs +0 -0
- package/dist/build-DVley5x8.d.cts.map +0 -1
- package/dist/build-D_6wweLB.mjs +0 -1
- package/dist/helpers-DvTULET6.mjs +0 -1
- package/dist/helpers-yB1XkvQI.cjs +0 -0
- package/dist/index-C-svZlpj.d.mts +0 -1
- package/dist/index-CFG0_wK4.d.cts +0 -1
- package/dist/index-CtCMUyZA.d.cts +0 -1
- package/dist/index-DWe68pTi.d.mts +0 -1
- package/dist/plugin-BDnHvJzN.d.mts.map +0 -1
- package/dist/plugin-BMA81Whw.d.cts.map +0 -1
- package/dist/plugin-D5qyQPqC.cjs +0 -0
- package/dist/plugin-HyYPEfea.mjs +0 -1
- package/dist/resolve-options-CZfGIJwj.mjs +0 -69
- package/dist/resolve-options-CZfGIJwj.mjs.map +0 -1
- package/dist/resolve-options-D-xqROJb.d.mts.map +0 -1
- package/dist/resolve-options-PlPrxfl4.d.cts.map +0 -1
- package/dist/unplugin-BIIMkEyS.cjs +0 -16
- package/dist/unplugin-B_SxYRZq.d.mts +0 -8
- package/dist/unplugin-B_SxYRZq.d.mts.map +0 -1
- package/dist/unplugin-CmW69N5s.mjs +0 -11
- package/dist/unplugin-CmW69N5s.mjs.map +0 -1
- package/dist/unplugin-dYAPcpXk.d.cts +0 -8
- package/dist/unplugin-dYAPcpXk.d.cts.map +0 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the <b>🔌 Powerlines</b> monorepo. Powerlines is the "
|
|
|
27
27
|
|
|
28
28
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
29
29
|
|
|
30
|
-
[](https://stormsoftware.com/projects/powerlines) [](http://commitizen.github.io/cz-cli/)  
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
|
@@ -58,21 +58,19 @@ A package containing a Powerlines plugin to assist in developing other Powerline
|
|
|
58
58
|
|
|
59
59
|
## Table of Contents
|
|
60
60
|
|
|
61
|
-
- [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
- [
|
|
65
|
-
- [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- [Contributing](#contributing)
|
|
75
|
-
- [Contributors](#contributors)
|
|
61
|
+
- [Installing](#installing)
|
|
62
|
+
- [Reduced Package Size](#reduced-package-size)
|
|
63
|
+
- [Development](#development)
|
|
64
|
+
- [Building](#building)
|
|
65
|
+
- [Running unit tests](#running-unit-tests)
|
|
66
|
+
- [Linting](#linting)
|
|
67
|
+
- [Storm Workspaces](#storm-workspaces)
|
|
68
|
+
- [Roadmap](#roadmap)
|
|
69
|
+
- [Support](#support)
|
|
70
|
+
- [License](#license)
|
|
71
|
+
- [Changelog](#changelog)
|
|
72
|
+
- [Contributing](#contributing)
|
|
73
|
+
- [Contributors](#contributors)
|
|
76
74
|
|
|
77
75
|
<!-- END doctoc -->
|
|
78
76
|
|
|
@@ -10,4 +10,4 @@ type ViteOptions = Omit<UserConfig, "entry" | "entryPoints" | "tsconfig" | "tsco
|
|
|
10
10
|
declare type __ΩViteOptions = any[];
|
|
11
11
|
//#endregion
|
|
12
12
|
export { __ΩViteOptions as n, ViteOptions as t };
|
|
13
|
-
//# sourceMappingURL=build-
|
|
13
|
+
//# sourceMappingURL=build-CksBpNAL.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-CksBpNAL.d.cts","names":[],"sources":["../src/types/build.ts"],"mappings":";;;KAoBY,WAAA,GAAc,IAAA,CACxB,UAAA;;AADF;;EAeE,YAAA,GAAe,IAAA,CAAK,sBAAA;AAAA;AAAA"}
|
|
@@ -10,4 +10,4 @@ type ViteOptions = Omit<UserConfig, "entry" | "entryPoints" | "tsconfig" | "tsco
|
|
|
10
10
|
declare type __ΩViteOptions = any[];
|
|
11
11
|
//#endregion
|
|
12
12
|
export { __ΩViteOptions as n, ViteOptions as t };
|
|
13
|
-
//# sourceMappingURL=build-
|
|
13
|
+
//# sourceMappingURL=build-DST9kC_L.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-DST9kC_L.d.mts","names":[],"sources":["../src/types/build.ts"],"mappings":";;;KAoBY,WAAA,GAAc,IAAA,CACxB,UAAA;;AADF;;EAeE,YAAA,GAAe,IAAA,CAAK,sBAAA;AAAA;AAAA"}
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
require('
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_resolve_options = require('../resolve-options-DZOdIilz.cjs');
|
|
3
|
+
const require_helpers_unplugin = require('./unplugin.cjs');
|
|
4
4
|
|
|
5
5
|
exports.DEFAULT_VITE_CONFIG = require_resolve_options.DEFAULT_VITE_CONFIG;
|
|
6
|
-
exports.createVitePlugin =
|
|
6
|
+
exports.createVitePlugin = require_helpers_unplugin.createVitePlugin;
|
|
7
7
|
exports.resolveOptions = require_resolve_options.resolveOptions;
|
package/dist/helpers/index.d.cts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "../resolve-options-
|
|
2
|
-
import "../
|
|
3
|
-
import { t as createVitePlugin } from "../unplugin-dYAPcpXk.cjs";
|
|
4
|
-
import "../index-CtCMUyZA.cjs";
|
|
1
|
+
import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "../resolve-options-MOVKz6QN.cjs";
|
|
2
|
+
import { t as createVitePlugin } from "../unplugin-Csj_0MkH.cjs";
|
|
5
3
|
export { DEFAULT_VITE_CONFIG, createVitePlugin, resolveOptions };
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import {
|
|
3
|
-
import "../plugin-BDnHvJzN.mjs";
|
|
4
|
-
import { t as createVitePlugin } from "../unplugin-B_SxYRZq.mjs";
|
|
5
|
-
import "../index-DWe68pTi.mjs";
|
|
1
|
+
import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "../resolve-options-BxqjvL8P.mjs";
|
|
2
|
+
import { t as createVitePlugin } from "../unplugin-Cs_a2k7X.mjs";
|
|
6
3
|
export { DEFAULT_VITE_CONFIG, createVitePlugin, resolveOptions };
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "../helpers-DvTULET6.mjs";
|
|
1
|
+
import { DEFAULT_VITE_CONFIG, resolveOptions } from "./resolve-options.mjs";
|
|
2
|
+
import { createVitePlugin } from "./unplugin.mjs";
|
|
4
3
|
|
|
5
4
|
export { DEFAULT_VITE_CONFIG, createVitePlugin, resolveOptions };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_resolve_options = require('../resolve-options-DZOdIilz.cjs');
|
|
2
3
|
|
|
3
4
|
exports.DEFAULT_VITE_CONFIG = require_resolve_options.DEFAULT_VITE_CONFIG;
|
|
4
5
|
exports.resolveOptions = require_resolve_options.resolveOptions;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "../resolve-options-
|
|
1
|
+
import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "../resolve-options-MOVKz6QN.cjs";
|
|
2
2
|
export { DEFAULT_VITE_CONFIG, resolveOptions };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "../resolve-options-D-xqROJb.mjs";
|
|
1
|
+
import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "../resolve-options-BxqjvL8P.mjs";
|
|
3
2
|
export { DEFAULT_VITE_CONFIG, resolveOptions };
|
|
@@ -1,3 +1,69 @@
|
|
|
1
|
-
import
|
|
1
|
+
import defu from "defu";
|
|
2
|
+
import { resolveOptions as resolveOptions$1 } from "@powerlines/plugin-esbuild/helpers/resolve-options";
|
|
3
|
+
import { resolveOptions as resolveOptions$2 } from "@powerlines/plugin-rolldown/helpers/resolve-options";
|
|
4
|
+
import { resolveOptions as resolveOptions$3 } from "@powerlines/plugin-rollup/helpers/resolve-options";
|
|
5
|
+
import { joinPaths } from "@stryke/path/join-paths";
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
//#region src/helpers/resolve-options.ts
|
|
8
|
+
const DEFAULT_VITE_CONFIG = {
|
|
9
|
+
resolve: { extensions: [
|
|
10
|
+
".mjs",
|
|
11
|
+
".js",
|
|
12
|
+
".mts",
|
|
13
|
+
".ts",
|
|
14
|
+
".jsx",
|
|
15
|
+
".tsx",
|
|
16
|
+
".json"
|
|
17
|
+
] },
|
|
18
|
+
json: { stringify: true },
|
|
19
|
+
logLevel: "silent",
|
|
20
|
+
clearScreen: true
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Resolves the options for [vite](https://vitejs.dev/).
|
|
24
|
+
*
|
|
25
|
+
* @param context - The build context.
|
|
26
|
+
* @returns The resolved options.
|
|
27
|
+
*/
|
|
28
|
+
function resolveOptions(context) {
|
|
29
|
+
return defu({ resolve: {
|
|
30
|
+
alias: Object.entries(context.alias).reduce((ret, [id, path]) => {
|
|
31
|
+
if (!ret.find((e) => e.find === id)) ret.push({
|
|
32
|
+
find: id,
|
|
33
|
+
replacement: path
|
|
34
|
+
});
|
|
35
|
+
else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
|
|
36
|
+
return ret;
|
|
37
|
+
}, []),
|
|
38
|
+
dedupe: context.config.resolve.dedupe,
|
|
39
|
+
mainFields: context.config.resolve.mainFields,
|
|
40
|
+
conditions: context.config.resolve.conditions,
|
|
41
|
+
extensions: context.config.resolve.extensions
|
|
42
|
+
} }, context.config.vite ? defu(context.config.vite, { optimizeDeps: context.config.vite?.optimizeDeps ?? {} }, { optimizeDeps: { extensions: context.config.resolve.extensions } }) : {}, {
|
|
43
|
+
define: context.config.define,
|
|
44
|
+
rootDir: context.fs.existsSync(joinPaths(context.config.root, "src")) ? joinPaths(context.config.root, "src") : context.config.root,
|
|
45
|
+
platform: context.config.platform,
|
|
46
|
+
mode: context.config.mode === "development" ? "development" : "production",
|
|
47
|
+
cacheDir: joinPaths(context.cachePath, "vite"),
|
|
48
|
+
build: {
|
|
49
|
+
minify: context.config.mode !== "development",
|
|
50
|
+
metafile: context.config.mode === "development",
|
|
51
|
+
sourcemap: context.config.mode === "development",
|
|
52
|
+
outDir: context.config.output.buildPath,
|
|
53
|
+
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
54
|
+
tsconfigRaw: context.tsconfig.tsconfigJson
|
|
55
|
+
},
|
|
56
|
+
esbuild: resolveOptions$1(context),
|
|
57
|
+
optimizeDeps: {
|
|
58
|
+
rolldownOptions: resolveOptions$2(context),
|
|
59
|
+
rollupOptions: resolveOptions$3(context),
|
|
60
|
+
esbuildOptions: resolveOptions$1(context)
|
|
61
|
+
},
|
|
62
|
+
logLevel: context.config.logLevel ?? void 0,
|
|
63
|
+
envDir: context.config.root
|
|
64
|
+
}, DEFAULT_VITE_CONFIG);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
export { DEFAULT_VITE_CONFIG, resolveOptions };
|
|
69
|
+
//# sourceMappingURL=resolve-options.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-options.mjs","names":["resolveEsbuildOptions","resolveRolldownOptions","resolveRollupOptions"],"sources":["../../src/helpers/resolve-options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Context } from \"@powerlines/core\";\nimport { resolveOptions as resolveEsbuildOptions } from \"@powerlines/plugin-esbuild/helpers/resolve-options\";\nimport { resolveOptions as resolveRolldownOptions } from \"@powerlines/plugin-rolldown/helpers/resolve-options\";\nimport { resolveOptions as resolveRollupOptions } from \"@powerlines/plugin-rollup/helpers/resolve-options\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { ESBuildOptions } from \"vite\";\nimport { VitePluginResolvedConfig } from \"../types\";\nimport { ViteOptions } from \"../types/build\";\n\nexport const DEFAULT_VITE_CONFIG: Partial<ViteOptions> = {\n resolve: {\n extensions: [\".mjs\", \".js\", \".mts\", \".ts\", \".jsx\", \".tsx\", \".json\"]\n },\n json: {\n stringify: true\n },\n logLevel: \"silent\",\n clearScreen: true\n};\n\n/**\n * Resolves the options for [vite](https://vitejs.dev/).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): ViteOptions {\n return defu(\n {\n resolve: {\n alias: Object.entries(context.alias).reduce(\n (ret, [id, path]) => {\n if (!ret.find(e => e.find === id)) {\n ret.push({\n find: id,\n replacement: path\n });\n } else {\n context.warn(\n `Duplicate alias entry for '${id}' detected. The first entry will be used.`\n );\n }\n\n return ret;\n },\n [] as { find: string; replacement: string }[]\n ),\n dedupe: context.config.resolve.dedupe,\n mainFields: context.config.resolve.mainFields,\n conditions: context.config.resolve.conditions,\n extensions: context.config.resolve.extensions\n }\n },\n (context.config as VitePluginResolvedConfig).vite\n ? defu(\n (context.config as VitePluginResolvedConfig).vite,\n {\n optimizeDeps:\n (context.config as VitePluginResolvedConfig).vite?.optimizeDeps ??\n {}\n },\n {\n optimizeDeps: {\n extensions: context.config.resolve.extensions\n }\n }\n )\n : {},\n {\n define: context.config.define,\n rootDir: context.fs.existsSync(joinPaths(context.config.root, \"src\"))\n ? joinPaths(context.config.root, \"src\")\n : context.config.root,\n platform: context.config.platform,\n mode:\n context.config.mode === \"development\" ? \"development\" : \"production\",\n cacheDir: joinPaths(context.cachePath, \"vite\"),\n build: {\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\",\n outDir: context.config.output.buildPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n tsconfigRaw: context.tsconfig.tsconfigJson\n },\n esbuild: resolveEsbuildOptions(context) as ESBuildOptions,\n optimizeDeps: {\n rolldownOptions: resolveRolldownOptions(context),\n rollupOptions: resolveRollupOptions(context),\n esbuildOptions: resolveEsbuildOptions(context)\n },\n logLevel: context.config.logLevel ?? undefined,\n envDir: context.config.root\n } as ViteOptions,\n DEFAULT_VITE_CONFIG\n ) as ViteOptions;\n}\n"],"mappings":";;;;;;;AA4BA,MAAa,sBAA4C;CACvD,SAAS,EACP,YAAY;EAAC;EAAQ;EAAO;EAAQ;EAAO;EAAQ;EAAQ;EAAQ,EACpE;CACD,MAAM,EACJ,WAAW,MACZ;CACD,UAAU;CACV,aAAa;CACd;;;;;;;AAQD,SAAgB,eAAe,SAA+B;AAC5D,QAAO,KACL,EACE,SAAS;EACP,OAAO,OAAO,QAAQ,QAAQ,MAAM,CAAC,QAClC,KAAK,CAAC,IAAI,UAAU;AACnB,OAAI,CAAC,IAAI,MAAK,MAAK,EAAE,SAAS,GAAG,CAC/B,KAAI,KAAK;IACP,MAAM;IACN,aAAa;IACd,CAAC;OAEF,SAAQ,KACN,8BAA8B,GAAG,2CAClC;AAGH,UAAO;KAET,EAAE,CACH;EACD,QAAQ,QAAQ,OAAO,QAAQ;EAC/B,YAAY,QAAQ,OAAO,QAAQ;EACnC,YAAY,QAAQ,OAAO,QAAQ;EACnC,YAAY,QAAQ,OAAO,QAAQ;EACpC,EACF,EACA,QAAQ,OAAoC,OACzC,KACG,QAAQ,OAAoC,MAC7C,EACE,cACG,QAAQ,OAAoC,MAAM,gBACnD,EAAE,EACL,EACD,EACE,cAAc,EACZ,YAAY,QAAQ,OAAO,QAAQ,YACpC,EACF,CACF,GACD,EAAE,EACN;EACE,QAAQ,QAAQ,OAAO;EACvB,SAAS,QAAQ,GAAG,WAAW,UAAU,QAAQ,OAAO,MAAM,MAAM,CAAC,GACjE,UAAU,QAAQ,OAAO,MAAM,MAAM,GACrC,QAAQ,OAAO;EACnB,UAAU,QAAQ,OAAO;EACzB,MACE,QAAQ,OAAO,SAAS,gBAAgB,gBAAgB;EAC1D,UAAU,UAAU,QAAQ,WAAW,OAAO;EAC9C,OAAO;GACL,QAAQ,QAAQ,OAAO,SAAS;GAChC,UAAU,QAAQ,OAAO,SAAS;GAClC,WAAW,QAAQ,OAAO,SAAS;GACnC,QAAQ,QAAQ,OAAO,OAAO;GAC9B,UAAU,QAAQ,SAAS;GAC3B,aAAa,QAAQ,SAAS;GAC/B;EACD,SAASA,iBAAsB,QAAQ;EACvC,cAAc;GACZ,iBAAiBC,iBAAuB,QAAQ;GAChD,eAAeC,iBAAqB,QAAQ;GAC5C,gBAAgBF,iBAAsB,QAAQ;GAC/C;EACD,UAAU,QAAQ,OAAO,YAAY;EACrC,QAAQ,QAAQ,OAAO;EACxB,EACD,oBACD"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_resolve_options = require('../resolve-options-DZOdIilz.cjs');
|
|
3
|
+
let _powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
|
|
4
|
+
let unplugin = require("unplugin");
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
//#region src/helpers/unplugin.ts
|
|
7
|
+
function createVitePlugin(context) {
|
|
8
|
+
return (0, unplugin.createVitePlugin)((0, _powerlines_core_lib_unplugin.createUnplugin)(context))({});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.createVitePlugin = createVitePlugin;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createUnplugin } from "@powerlines/core/lib/unplugin";
|
|
2
|
+
import { createVitePlugin as createVitePlugin$1 } from "unplugin";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
//#region src/helpers/unplugin.ts
|
|
5
|
+
function createVitePlugin(context) {
|
|
6
|
+
return createVitePlugin$1(createUnplugin(context))({});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { createVitePlugin };
|
|
11
|
+
//# sourceMappingURL=unplugin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin.mjs","names":["createViteUnplugin"],"sources":["../../src/helpers/unplugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { createUnplugin } from \"@powerlines/core/lib/unplugin\";\nimport { createVitePlugin as createViteUnplugin } from \"unplugin\";\nimport { VitePluginContext } from \"../types/plugin\";\n\nexport function createVitePlugin(context: VitePluginContext) {\n return createViteUnplugin(createUnplugin(context))({});\n}\n"],"mappings":";;;;AAsBA,SAAgB,iBAAiB,SAA4B;AAC3D,QAAOA,mBAAmB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Object.
|
|
2
|
-
const require_resolve_options = require('./resolve-options-
|
|
3
|
-
const
|
|
4
|
-
require('./helpers
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
+
const require_resolve_options = require('./resolve-options-DZOdIilz.cjs');
|
|
3
|
+
const require_helpers_unplugin = require('./helpers/unplugin.cjs');
|
|
4
|
+
require('./helpers/index.cjs');
|
|
5
5
|
require('./types/index.cjs');
|
|
6
6
|
let defu = require("defu");
|
|
7
7
|
defu = require_resolve_options.__toESM(defu);
|
|
@@ -34,15 +34,14 @@ const plugin = (options = {}) => {
|
|
|
34
34
|
config: false,
|
|
35
35
|
entry: this.entry,
|
|
36
36
|
environments: Object.fromEntries(Object.entries(environments).map(([name, env]) => [name, require_resolve_options.resolveOptions(env)]))
|
|
37
|
-
}, require_resolve_options.resolveOptions(this), { plugins: [
|
|
37
|
+
}, require_resolve_options.resolveOptions(this), { plugins: [require_helpers_unplugin.createVitePlugin(this)] }));
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
var src_default = plugin;
|
|
42
41
|
|
|
43
42
|
//#endregion
|
|
44
43
|
exports.DEFAULT_VITE_CONFIG = require_resolve_options.DEFAULT_VITE_CONFIG;
|
|
45
|
-
exports.createVitePlugin =
|
|
46
|
-
exports.default =
|
|
44
|
+
exports.createVitePlugin = require_helpers_unplugin.createVitePlugin;
|
|
45
|
+
exports.default = plugin;
|
|
47
46
|
exports.plugin = plugin;
|
|
48
47
|
exports.resolveOptions = require_resolve_options.resolveOptions;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { n as __ΩViteOptions, t as ViteOptions } from "./build-
|
|
2
|
-
import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "./resolve-options-
|
|
3
|
-
import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "./plugin-
|
|
4
|
-
import { t as createVitePlugin } from "./unplugin-
|
|
5
|
-
import "./index-CtCMUyZA.cjs";
|
|
6
|
-
import "./index-CFG0_wK4.cjs";
|
|
1
|
+
import { n as __ΩViteOptions, t as ViteOptions } from "./build-CksBpNAL.cjs";
|
|
2
|
+
import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "./resolve-options-MOVKz6QN.cjs";
|
|
3
|
+
import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "./plugin-Bh-B80x0.cjs";
|
|
4
|
+
import { t as createVitePlugin } from "./unplugin-Csj_0MkH.cjs";
|
|
7
5
|
import { Plugin } from "@powerlines/core";
|
|
8
6
|
|
|
9
7
|
//#region src/index.d.ts
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;YAkCY,MAAA;IACR,IAAA,GAAO,iBAAA;EAAA;AAAA;AAJa;;;AAAA,cAWX,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { n as __ΩViteOptions, t as ViteOptions } from "./build-
|
|
2
|
-
import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "./resolve-options-
|
|
3
|
-
import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "./plugin-
|
|
4
|
-
import { t as createVitePlugin } from "./unplugin-
|
|
5
|
-
import "./index-DWe68pTi.mjs";
|
|
6
|
-
import "./index-C-svZlpj.mjs";
|
|
1
|
+
import { n as __ΩViteOptions, t as ViteOptions } from "./build-DST9kC_L.mjs";
|
|
2
|
+
import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "./resolve-options-BxqjvL8P.mjs";
|
|
3
|
+
import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "./plugin-DE3oU3V6.mjs";
|
|
4
|
+
import { t as createVitePlugin } from "./unplugin-Cs_a2k7X.mjs";
|
|
7
5
|
import { Plugin } from "@powerlines/core";
|
|
8
6
|
|
|
9
7
|
//#region src/index.d.ts
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;YAkCY,MAAA;IACR,IAAA,GAAO,iBAAA;EAAA;AAAA;AAJa;;;AAAA,cAWX,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "./helpers
|
|
1
|
+
import { DEFAULT_VITE_CONFIG, resolveOptions } from "./helpers/resolve-options.mjs";
|
|
2
|
+
import { createVitePlugin } from "./helpers/unplugin.mjs";
|
|
3
|
+
import "./helpers/index.mjs";
|
|
4
4
|
import "./types/index.mjs";
|
|
5
5
|
import defu from "defu";
|
|
6
6
|
import { build } from "vite";
|
|
@@ -36,8 +36,7 @@ const plugin = (options = {}) => {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
|
-
var src_default = plugin;
|
|
40
39
|
|
|
41
40
|
//#endregion
|
|
42
|
-
export { DEFAULT_VITE_CONFIG, createVitePlugin,
|
|
41
|
+
export { DEFAULT_VITE_CONFIG, createVitePlugin, plugin as default, plugin, resolveOptions };
|
|
43
42
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Context, Plugin } from \"@powerlines/core\";\nimport defu from \"defu\";\nimport { build, InlineConfig } from \"vite\";\nimport { DEFAULT_VITE_CONFIG, resolveOptions } from \"./helpers/resolve-options\";\nimport { createVitePlugin } from \"./helpers/unplugin\";\nimport { UNSAFE_VitePluginContext } from \"./types/_internal\";\nimport {\n VitePluginContext,\n VitePluginOptions,\n VitePluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n vite?: VitePluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <TContext extends VitePluginContext = VitePluginContext>(\n options: VitePluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"vite\",\n config() {\n this.trace(\n \"Providing default configuration for the Powerlines `vite` build plugin.\"\n );\n\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n vite: {\n ...DEFAULT_VITE_CONFIG,\n ...options\n },\n singleBuild: true\n } as Partial<VitePluginResolvedConfig>;\n },\n async build() {\n this.trace(`Building the Powerlines plugin.`);\n\n const environments = (this as unknown as UNSAFE_VitePluginContext)\n ?.$$internal?.api?.context?.environments;\n if (!environments || Object.keys(environments).length === 0) {\n throw new Error(\n `No environments found in the Powerlines context. At least one environment should have been generated - please report this issue to https://github.com/storm-software/powerlines/issues.`\n );\n }\n\n this.trace(\n `Running Vite for ${Object.keys(environments).length} environments.`\n );\n\n const config = defu(\n {\n config: false,\n entry: this.entry,\n environments: Object.fromEntries(\n Object.entries(environments).map(([name, env]) => [\n name,\n resolveOptions(env as Context)\n ])\n )\n },\n resolveOptions(this),\n {\n plugins: [createVitePlugin(this)]\n }\n );\n\n await build(config as InlineConfig);\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AA0CA,MAAa,UACX,UAA6B,EAAE,KACV;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,QAAK,MACH,0EACD;AAED,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,MAAM;KACJ,GAAG;KACH,GAAG;KACJ;IACD,aAAa;IACd;;EAEH,MAAM,QAAQ;AACZ,QAAK,MAAM,kCAAkC;GAE7C,MAAM,eAAgB,MAClB,YAAY,KAAK,SAAS;AAC9B,OAAI,CAAC,gBAAgB,OAAO,KAAK,aAAa,CAAC,WAAW,EACxD,OAAM,IAAI,MACR,0LACD;AAGH,QAAK,MACH,oBAAoB,OAAO,KAAK,aAAa,CAAC,OAAO,gBACtD;AAmBD,SAAM,MAjBS,KACb;IACE,QAAQ;IACR,OAAO,KAAK;IACZ,cAAc,OAAO,YACnB,OAAO,QAAQ,aAAa,CAAC,KAAK,CAAC,MAAM,SAAS,CAChD,MACA,eAAe,IAAe,CAC/B,CAAC,CACH;IACF,EACD,eAAe,KAAK,EACpB,EACE,SAAS,CAAC,iBAAiB,KAAK,CAAC,EAClC,CACF,CAEkC;;EAEtC
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Context, Plugin } from \"@powerlines/core\";\nimport defu from \"defu\";\nimport { build, InlineConfig } from \"vite\";\nimport { DEFAULT_VITE_CONFIG, resolveOptions } from \"./helpers/resolve-options\";\nimport { createVitePlugin } from \"./helpers/unplugin\";\nimport { UNSAFE_VitePluginContext } from \"./types/_internal\";\nimport {\n VitePluginContext,\n VitePluginOptions,\n VitePluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n vite?: VitePluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <TContext extends VitePluginContext = VitePluginContext>(\n options: VitePluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"vite\",\n config() {\n this.trace(\n \"Providing default configuration for the Powerlines `vite` build plugin.\"\n );\n\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n vite: {\n ...DEFAULT_VITE_CONFIG,\n ...options\n },\n singleBuild: true\n } as Partial<VitePluginResolvedConfig>;\n },\n async build() {\n this.trace(`Building the Powerlines plugin.`);\n\n const environments = (this as unknown as UNSAFE_VitePluginContext)\n ?.$$internal?.api?.context?.environments;\n if (!environments || Object.keys(environments).length === 0) {\n throw new Error(\n `No environments found in the Powerlines context. At least one environment should have been generated - please report this issue to https://github.com/storm-software/powerlines/issues.`\n );\n }\n\n this.trace(\n `Running Vite for ${Object.keys(environments).length} environments.`\n );\n\n const config = defu(\n {\n config: false,\n entry: this.entry,\n environments: Object.fromEntries(\n Object.entries(environments).map(([name, env]) => [\n name,\n resolveOptions(env as Context)\n ])\n )\n },\n resolveOptions(this),\n {\n plugins: [createVitePlugin(this)]\n }\n );\n\n await build(config as InlineConfig);\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AA0CA,MAAa,UACX,UAA6B,EAAE,KACV;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,QAAK,MACH,0EACD;AAED,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,MAAM;KACJ,GAAG;KACH,GAAG;KACJ;IACD,aAAa;IACd;;EAEH,MAAM,QAAQ;AACZ,QAAK,MAAM,kCAAkC;GAE7C,MAAM,eAAgB,MAClB,YAAY,KAAK,SAAS;AAC9B,OAAI,CAAC,gBAAgB,OAAO,KAAK,aAAa,CAAC,WAAW,EACxD,OAAM,IAAI,MACR,0LACD;AAGH,QAAK,MACH,oBAAoB,OAAO,KAAK,aAAa,CAAC,OAAO,gBACtD;AAmBD,SAAM,MAjBS,KACb;IACE,QAAQ;IACR,OAAO,KAAK;IACZ,cAAc,OAAO,YACnB,OAAO,QAAQ,aAAa,CAAC,KAAK,CAAC,MAAM,SAAS,CAChD,MACA,eAAe,IAAe,CAC/B,CAAC,CACH;IACF,EACD,eAAe,KAAK,EACpB,EACE,SAAS,CAAC,iBAAiB,KAAK,CAAC,EAClC,CACF,CAEkC;;EAEtC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ViteOptions } from "./build-
|
|
1
|
+
import { t as ViteOptions } from "./build-CksBpNAL.cjs";
|
|
2
2
|
import { ConfigEnv, PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
|
|
3
3
|
|
|
4
4
|
//#region src/types/plugin.d.ts
|
|
@@ -19,4 +19,4 @@ declare type __ΩVitePluginResolvedConfig = any[];
|
|
|
19
19
|
declare type __ΩVitePluginContext = any[];
|
|
20
20
|
//#endregion
|
|
21
21
|
export { __ΩVitePluginContext as a, __ΩVitePluginUserConfig as c, VitePluginUserConfig as i, VitePluginOptions as n, __ΩVitePluginOptions as o, VitePluginResolvedConfig as r, __ΩVitePluginResolvedConfig as s, VitePluginContext as t };
|
|
22
|
-
//# sourceMappingURL=plugin-
|
|
22
|
+
//# sourceMappingURL=plugin-Bh-B80x0.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-Bh-B80x0.d.cts","names":[],"sources":["../src/types/plugin.ts"],"mappings":";;;;KA0BY,iBAAA,GAAoB,OAAA,CAAQ,WAAA;AAAA,UAEvB,oBAAA,SAA6B,UAAA;EAC5C,IAAA,GAAO,iBAAA;AAAA;AAAA,UAGQ,wBAAA,SAAiC,cAAA;EAChD,IAAA,EAAM,WAAA;AAAA;AAAA,KAGI,iBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,aAAA,CAAc,eAAA;EAChB,GAAA;EACA,SAAA,EAAW,SAAA;AAAA;AAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ViteOptions } from "./build-
|
|
1
|
+
import { t as ViteOptions } from "./build-DST9kC_L.mjs";
|
|
2
2
|
import { ConfigEnv, PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
|
|
3
3
|
|
|
4
4
|
//#region src/types/plugin.d.ts
|
|
@@ -19,4 +19,4 @@ declare type __ΩVitePluginResolvedConfig = any[];
|
|
|
19
19
|
declare type __ΩVitePluginContext = any[];
|
|
20
20
|
//#endregion
|
|
21
21
|
export { __ΩVitePluginContext as a, __ΩVitePluginUserConfig as c, VitePluginUserConfig as i, VitePluginOptions as n, __ΩVitePluginOptions as o, VitePluginResolvedConfig as r, __ΩVitePluginResolvedConfig as s, VitePluginContext as t };
|
|
22
|
-
//# sourceMappingURL=plugin-
|
|
22
|
+
//# sourceMappingURL=plugin-DE3oU3V6.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-DE3oU3V6.d.mts","names":[],"sources":["../src/types/plugin.ts"],"mappings":";;;;KA0BY,iBAAA,GAAoB,OAAA,CAAQ,WAAA;AAAA,UAEvB,oBAAA,SAA6B,UAAA;EAC5C,IAAA,GAAO,iBAAA;AAAA;AAAA,UAGQ,wBAAA,SAAiC,cAAA;EAChD,IAAA,EAAM,WAAA;AAAA;AAAA,KAGI,iBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,aAAA,CAAc,eAAA;EAChB,GAAA;EACA,SAAA,EAAW,SAAA;AAAA;AAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ViteOptions } from "./build-
|
|
1
|
+
import { t as ViteOptions } from "./build-DST9kC_L.mjs";
|
|
2
2
|
import { Context } from "@powerlines/core";
|
|
3
3
|
|
|
4
4
|
//#region src/helpers/resolve-options.d.ts
|
|
@@ -12,4 +12,4 @@ declare const DEFAULT_VITE_CONFIG: Partial<ViteOptions>;
|
|
|
12
12
|
declare function resolveOptions(context: Context): ViteOptions;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { resolveOptions as n, DEFAULT_VITE_CONFIG as t };
|
|
15
|
-
//# sourceMappingURL=resolve-options-
|
|
15
|
+
//# sourceMappingURL=resolve-options-BxqjvL8P.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-options-BxqjvL8P.d.mts","names":[],"sources":["../src/helpers/resolve-options.ts"],"mappings":";;;;cA4Ba,mBAAA,EAAqB,OAAA,CAAQ,WAAA;;AAA1C;;;;;iBAiBgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,WAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -27,10 +27,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
//#endregion
|
|
28
28
|
let defu = require("defu");
|
|
29
29
|
defu = __toESM(defu);
|
|
30
|
-
let
|
|
31
|
-
let
|
|
32
|
-
let
|
|
33
|
-
let
|
|
30
|
+
let _powerlines_plugin_esbuild_helpers_resolve_options = require("@powerlines/plugin-esbuild/helpers/resolve-options");
|
|
31
|
+
let _powerlines_plugin_rolldown_helpers_resolve_options = require("@powerlines/plugin-rolldown/helpers/resolve-options");
|
|
32
|
+
let _powerlines_plugin_rollup_helpers_resolve_options = require("@powerlines/plugin-rollup/helpers/resolve-options");
|
|
33
|
+
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
34
34
|
|
|
35
35
|
//#region src/helpers/resolve-options.ts
|
|
36
36
|
const DEFAULT_VITE_CONFIG = {
|
|
@@ -69,10 +69,10 @@ function resolveOptions(context) {
|
|
|
69
69
|
extensions: context.config.resolve.extensions
|
|
70
70
|
} }, context.config.vite ? (0, defu.default)(context.config.vite, { optimizeDeps: context.config.vite?.optimizeDeps ?? {} }, { optimizeDeps: { extensions: context.config.resolve.extensions } }) : {}, {
|
|
71
71
|
define: context.config.define,
|
|
72
|
-
rootDir: context.fs.existsSync((0,
|
|
72
|
+
rootDir: context.fs.existsSync((0, _stryke_path_join_paths.joinPaths)(context.config.root, "src")) ? (0, _stryke_path_join_paths.joinPaths)(context.config.root, "src") : context.config.root,
|
|
73
73
|
platform: context.config.platform,
|
|
74
74
|
mode: context.config.mode === "development" ? "development" : "production",
|
|
75
|
-
cacheDir: (0,
|
|
75
|
+
cacheDir: (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "vite"),
|
|
76
76
|
build: {
|
|
77
77
|
minify: context.config.mode !== "development",
|
|
78
78
|
metafile: context.config.mode === "development",
|
|
@@ -81,11 +81,11 @@ function resolveOptions(context) {
|
|
|
81
81
|
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
82
82
|
tsconfigRaw: context.tsconfig.tsconfigJson
|
|
83
83
|
},
|
|
84
|
-
esbuild: (0,
|
|
84
|
+
esbuild: (0, _powerlines_plugin_esbuild_helpers_resolve_options.resolveOptions)(context),
|
|
85
85
|
optimizeDeps: {
|
|
86
|
-
rolldownOptions: (0,
|
|
87
|
-
rollupOptions: (0,
|
|
88
|
-
esbuildOptions: (0,
|
|
86
|
+
rolldownOptions: (0, _powerlines_plugin_rolldown_helpers_resolve_options.resolveOptions)(context),
|
|
87
|
+
rollupOptions: (0, _powerlines_plugin_rollup_helpers_resolve_options.resolveOptions)(context),
|
|
88
|
+
esbuildOptions: (0, _powerlines_plugin_esbuild_helpers_resolve_options.resolveOptions)(context)
|
|
89
89
|
},
|
|
90
90
|
logLevel: context.config.logLevel ?? void 0,
|
|
91
91
|
envDir: context.config.root
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ViteOptions } from "./build-
|
|
1
|
+
import { t as ViteOptions } from "./build-CksBpNAL.cjs";
|
|
2
2
|
import { Context } from "@powerlines/core";
|
|
3
3
|
|
|
4
4
|
//#region src/helpers/resolve-options.d.ts
|
|
@@ -12,4 +12,4 @@ declare const DEFAULT_VITE_CONFIG: Partial<ViteOptions>;
|
|
|
12
12
|
declare function resolveOptions(context: Context): ViteOptions;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { resolveOptions as n, DEFAULT_VITE_CONFIG as t };
|
|
15
|
-
//# sourceMappingURL=resolve-options-
|
|
15
|
+
//# sourceMappingURL=resolve-options-MOVKz6QN.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-options-MOVKz6QN.d.cts","names":[],"sources":["../src/helpers/resolve-options.ts"],"mappings":";;;;cA4Ba,mBAAA,EAAqB,OAAA,CAAQ,WAAA;;AAA1C;;;;;iBAiBgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,WAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { r as VitePluginResolvedConfig } from "../plugin-
|
|
1
|
+
import { r as VitePluginResolvedConfig } from "../plugin-Bh-B80x0.cjs";
|
|
2
2
|
import { UNSAFE_PluginContext } from "@powerlines/core/types/_internal";
|
|
3
3
|
|
|
4
4
|
//#region src/types/_internal.d.ts
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* Internal fields and methods for internal Vite plugin contexts
|
|
8
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_internal.d.cts","names":[],"sources":["../../src/types/_internal.ts"],"
|
|
1
|
+
{"version":3,"file":"_internal.d.cts","names":[],"sources":["../../src/types/_internal.ts"],"mappings":";;;;;;AA0BA;;;KAAY,wBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,oBAAA,CAAqB,eAAA;AAAA"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import { r as VitePluginResolvedConfig } from "../plugin-BDnHvJzN.mjs";
|
|
1
|
+
import { r as VitePluginResolvedConfig } from "../plugin-DE3oU3V6.mjs";
|
|
3
2
|
import { UNSAFE_PluginContext } from "@powerlines/core/types/_internal";
|
|
4
3
|
|
|
5
4
|
//#region src/types/_internal.d.ts
|
|
6
|
-
|
|
7
5
|
/**
|
|
8
6
|
* Internal fields and methods for internal Vite plugin contexts
|
|
9
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_internal.d.mts","names":[],"sources":["../../src/types/_internal.ts"],"
|
|
1
|
+
{"version":3,"file":"_internal.d.mts","names":[],"sources":["../../src/types/_internal.ts"],"mappings":";;;;;;;AA0BA;;KAAY,wBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,oBAAA,CAAqB,eAAA;AAAA"}
|
package/dist/types/build.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as __ΩViteOptions, t as ViteOptions } from "../build-
|
|
1
|
+
import { n as __ΩViteOptions, t as ViteOptions } from "../build-CksBpNAL.cjs";
|
|
2
2
|
export { ViteOptions, __ΩViteOptions };
|
package/dist/types/build.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as __ΩViteOptions, t as ViteOptions } from "../build-
|
|
1
|
+
import { n as __ΩViteOptions, t as ViteOptions } from "../build-DST9kC_L.mjs";
|
|
2
2
|
export { ViteOptions, __ΩViteOptions };
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { n as __ΩViteOptions, t as ViteOptions } from "../build-
|
|
2
|
-
import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "../plugin-
|
|
3
|
-
import "../index-CFG0_wK4.cjs";
|
|
1
|
+
import { n as __ΩViteOptions, t as ViteOptions } from "../build-CksBpNAL.cjs";
|
|
2
|
+
import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "../plugin-Bh-B80x0.cjs";
|
|
4
3
|
export { ViteOptions, VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩViteOptions, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { n as __ΩViteOptions, t as ViteOptions } from "../build-
|
|
2
|
-
import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "../plugin-
|
|
3
|
-
import "../index-C-svZlpj.mjs";
|
|
1
|
+
import { n as __ΩViteOptions, t as ViteOptions } from "../build-DST9kC_L.mjs";
|
|
2
|
+
import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "../plugin-DE3oU3V6.mjs";
|
|
4
3
|
export { ViteOptions, VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩViteOptions, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "../plugin-
|
|
1
|
+
import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "../plugin-Bh-B80x0.cjs";
|
|
2
2
|
export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "../plugin-BDnHvJzN.mjs";
|
|
1
|
+
import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "../plugin-DE3oU3V6.mjs";
|
|
3
2
|
export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { t as VitePluginContext } from "./plugin-DE3oU3V6.mjs";
|
|
2
|
+
import * as vite from "vite";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/unplugin.d.ts
|
|
5
|
+
declare function createVitePlugin(context: VitePluginContext): vite.Plugin<any> | vite.Plugin<any>[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { createVitePlugin as t };
|
|
8
|
+
//# sourceMappingURL=unplugin-Cs_a2k7X.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin-Cs_a2k7X.d.mts","names":[],"sources":["../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,gBAAA,CAAiB,OAAA,EAAS,iBAAA,GAAiB,IAAA,CAAA,MAAA,QAAA,IAAA,CAAA,MAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { t as VitePluginContext } from "./plugin-Bh-B80x0.cjs";
|
|
2
|
+
import * as vite from "vite";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/unplugin.d.ts
|
|
5
|
+
declare function createVitePlugin(context: VitePluginContext): vite.Plugin<any> | vite.Plugin<any>[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { createVitePlugin as t };
|
|
8
|
+
//# sourceMappingURL=unplugin-Csj_0MkH.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin-Csj_0MkH.d.cts","names":[],"sources":["../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,gBAAA,CAAiB,OAAA,EAAS,iBAAA,GAAiB,IAAA,CAAA,MAAA,QAAA,IAAA,CAAA,MAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-vite",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.341",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"keywords": ["vite", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -40,34 +40,35 @@
|
|
|
40
40
|
],
|
|
41
41
|
"type": "module",
|
|
42
42
|
"exports": {
|
|
43
|
-
".": { "
|
|
43
|
+
".": { "import": "./dist/index.mjs", "require": "./dist/index.cjs" },
|
|
44
44
|
"./helpers": {
|
|
45
|
-
"
|
|
46
|
-
"
|
|
45
|
+
"import": "./dist/helpers/index.mjs",
|
|
46
|
+
"require": "./dist/helpers/index.cjs"
|
|
47
47
|
},
|
|
48
48
|
"./helpers/resolve-options": {
|
|
49
|
-
"
|
|
50
|
-
"
|
|
49
|
+
"import": "./dist/helpers/resolve-options.mjs",
|
|
50
|
+
"require": "./dist/helpers/resolve-options.cjs"
|
|
51
51
|
},
|
|
52
52
|
"./helpers/unplugin": {
|
|
53
|
-
"
|
|
54
|
-
"
|
|
53
|
+
"import": "./dist/helpers/unplugin.mjs",
|
|
54
|
+
"require": "./dist/helpers/unplugin.cjs"
|
|
55
55
|
},
|
|
56
|
+
"./resolve-options-DZOdIilz": "./dist/resolve-options-DZOdIilz.cjs",
|
|
56
57
|
"./types": {
|
|
57
|
-
"
|
|
58
|
-
"
|
|
58
|
+
"import": "./dist/types/index.mjs",
|
|
59
|
+
"require": "./dist/types/index.cjs"
|
|
59
60
|
},
|
|
60
61
|
"./types/_internal": {
|
|
61
|
-
"
|
|
62
|
-
"
|
|
62
|
+
"import": "./dist/types/_internal.mjs",
|
|
63
|
+
"require": "./dist/types/_internal.cjs"
|
|
63
64
|
},
|
|
64
65
|
"./types/build": {
|
|
65
|
-
"
|
|
66
|
-
"
|
|
66
|
+
"import": "./dist/types/build.mjs",
|
|
67
|
+
"require": "./dist/types/build.cjs"
|
|
67
68
|
},
|
|
68
69
|
"./types/plugin": {
|
|
69
|
-
"
|
|
70
|
-
"
|
|
70
|
+
"import": "./dist/types/plugin.mjs",
|
|
71
|
+
"require": "./dist/types/plugin.cjs"
|
|
71
72
|
},
|
|
72
73
|
"./*": "./*"
|
|
73
74
|
},
|
|
@@ -79,14 +80,14 @@
|
|
|
79
80
|
"peerDependencies": { "vite": ">=8.0.0-beta.16" },
|
|
80
81
|
"peerDependenciesMeta": { "vite": { "optional": false } },
|
|
81
82
|
"dependencies": {
|
|
82
|
-
"@powerlines/core": "^0.
|
|
83
|
-
"@powerlines/plugin-rolldown": "^0.7.
|
|
84
|
-
"@powerlines/plugin-rollup": "^0.7.
|
|
85
|
-
"@powerlines/plugin-esbuild": "^0.13.
|
|
83
|
+
"@powerlines/core": "^0.3.0",
|
|
84
|
+
"@powerlines/plugin-rolldown": "^0.7.348",
|
|
85
|
+
"@powerlines/plugin-rollup": "^0.7.347",
|
|
86
|
+
"@powerlines/plugin-esbuild": "^0.13.347",
|
|
86
87
|
"defu": "^6.1.4",
|
|
87
88
|
"unplugin": "^3.0.0"
|
|
88
89
|
},
|
|
89
90
|
"devDependencies": { "@types/node": "^25.4.0", "vite": "8.0.0-beta.16" },
|
|
90
91
|
"publishConfig": { "access": "public" },
|
|
91
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "40d1f94407720be23c3801f9145fdad1fe27dfb2"
|
|
92
93
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-BnD8f4L9.d.mts","names":[],"sources":["../src/types/build.ts"],"sourcesContent":[],"mappings":";;;KAoBY,WAAA,GAAc,KACxB;;AADF;;EAA0B,YAAA,CAAA,EAeT,IAfS,CAeJ,sBAfI,EAAA,YAAA,CAAA;CAeJ;AAAL,8BAAA,GAAA,EAAA"}
|
package/dist/build-DJTI0ZMx.cjs
DELETED
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-DVley5x8.d.cts","names":[],"sources":["../src/types/build.ts"],"sourcesContent":[],"mappings":";;;KAoBY,WAAA,GAAc,KACxB;;AADF;;EAA0B,YAAA,CAAA,EAeT,IAfS,CAeJ,sBAfI,EAAA,YAAA,CAAA;CAeJ;AAAL,8BAAA,GAAA,EAAA"}
|
package/dist/build-D_6wweLB.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-BDnHvJzN.d.mts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KA0BY,iBAAA,GAAoB,QAAQ;UAEvB,oBAAA,SAA6B;EAFlC,IAAA,CAAA,EAGH,iBAHoB;AAE7B;AAIiB,UAAA,wBAAA,SAAiC,cAAA,CAAA;EAItC,IAAA,EAHJ,WAGI;;AACyC,KADzC,iBACyC,CAAA,wBAA3B,wBAA2B,GAAA,wBAAA,CAAA,GACjD,aADiD,CACnC,eADmC,CAAA,GAAA;EACnC,GAAA,EAAA,OAAA;EAAd,SAAA,EAES,SAFT;CAES;AAAS,oCAAA,GAAA,EAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-BMA81Whw.d.cts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KA0BY,iBAAA,GAAoB,QAAQ;UAEvB,oBAAA,SAA6B;EAFlC,IAAA,CAAA,EAGH,iBAHoB;AAE7B;AAIiB,UAAA,wBAAA,SAAiC,cAAA,CAAA;EAItC,IAAA,EAHJ,WAGI;;AACyC,KADzC,iBACyC,CAAA,wBAA3B,wBAA2B,GAAA,wBAAA,CAAA,GACjD,aADiD,CACnC,eADmC,CAAA,GAAA;EACnC,GAAA,EAAA,OAAA;EAAd,SAAA,EAES,SAFT;CAES;AAAS,oCAAA,GAAA,EAAA"}
|
package/dist/plugin-D5qyQPqC.cjs
DELETED
|
File without changes
|
package/dist/plugin-HyYPEfea.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import defu from "defu";
|
|
2
|
-
import { resolveOptions } from "@powerlines/plugin-esbuild/helpers/resolve-options";
|
|
3
|
-
import { resolveOptions as resolveOptions$1 } from "@powerlines/plugin-rolldown/helpers/resolve-options";
|
|
4
|
-
import { resolveOptions as resolveOptions$2 } from "@powerlines/plugin-rollup/helpers/resolve-options";
|
|
5
|
-
import { joinPaths } from "@stryke/path/join-paths";
|
|
6
|
-
|
|
7
|
-
//#region src/helpers/resolve-options.ts
|
|
8
|
-
const DEFAULT_VITE_CONFIG = {
|
|
9
|
-
resolve: { extensions: [
|
|
10
|
-
".mjs",
|
|
11
|
-
".js",
|
|
12
|
-
".mts",
|
|
13
|
-
".ts",
|
|
14
|
-
".jsx",
|
|
15
|
-
".tsx",
|
|
16
|
-
".json"
|
|
17
|
-
] },
|
|
18
|
-
json: { stringify: true },
|
|
19
|
-
logLevel: "silent",
|
|
20
|
-
clearScreen: true
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Resolves the options for [vite](https://vitejs.dev/).
|
|
24
|
-
*
|
|
25
|
-
* @param context - The build context.
|
|
26
|
-
* @returns The resolved options.
|
|
27
|
-
*/
|
|
28
|
-
function resolveOptions$3(context) {
|
|
29
|
-
return defu({ resolve: {
|
|
30
|
-
alias: Object.entries(context.alias).reduce((ret, [id, path]) => {
|
|
31
|
-
if (!ret.find((e) => e.find === id)) ret.push({
|
|
32
|
-
find: id,
|
|
33
|
-
replacement: path
|
|
34
|
-
});
|
|
35
|
-
else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
|
|
36
|
-
return ret;
|
|
37
|
-
}, []),
|
|
38
|
-
dedupe: context.config.resolve.dedupe,
|
|
39
|
-
mainFields: context.config.resolve.mainFields,
|
|
40
|
-
conditions: context.config.resolve.conditions,
|
|
41
|
-
extensions: context.config.resolve.extensions
|
|
42
|
-
} }, context.config.vite ? defu(context.config.vite, { optimizeDeps: context.config.vite?.optimizeDeps ?? {} }, { optimizeDeps: { extensions: context.config.resolve.extensions } }) : {}, {
|
|
43
|
-
define: context.config.define,
|
|
44
|
-
rootDir: context.fs.existsSync(joinPaths(context.config.root, "src")) ? joinPaths(context.config.root, "src") : context.config.root,
|
|
45
|
-
platform: context.config.platform,
|
|
46
|
-
mode: context.config.mode === "development" ? "development" : "production",
|
|
47
|
-
cacheDir: joinPaths(context.cachePath, "vite"),
|
|
48
|
-
build: {
|
|
49
|
-
minify: context.config.mode !== "development",
|
|
50
|
-
metafile: context.config.mode === "development",
|
|
51
|
-
sourcemap: context.config.mode === "development",
|
|
52
|
-
outDir: context.config.output.buildPath,
|
|
53
|
-
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
54
|
-
tsconfigRaw: context.tsconfig.tsconfigJson
|
|
55
|
-
},
|
|
56
|
-
esbuild: resolveOptions(context),
|
|
57
|
-
optimizeDeps: {
|
|
58
|
-
rolldownOptions: resolveOptions$1(context),
|
|
59
|
-
rollupOptions: resolveOptions$2(context),
|
|
60
|
-
esbuildOptions: resolveOptions(context)
|
|
61
|
-
},
|
|
62
|
-
logLevel: context.config.logLevel ?? void 0,
|
|
63
|
-
envDir: context.config.root
|
|
64
|
-
}, DEFAULT_VITE_CONFIG);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
//#endregion
|
|
68
|
-
export { resolveOptions$3 as n, DEFAULT_VITE_CONFIG as t };
|
|
69
|
-
//# sourceMappingURL=resolve-options-CZfGIJwj.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options-CZfGIJwj.mjs","names":["DEFAULT_VITE_CONFIG: Partial<ViteOptions>","resolveOptions","resolveEsbuildOptions","resolveRolldownOptions","resolveRollupOptions"],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Context } from \"@powerlines/core\";\nimport { resolveOptions as resolveEsbuildOptions } from \"@powerlines/plugin-esbuild/helpers/resolve-options\";\nimport { resolveOptions as resolveRolldownOptions } from \"@powerlines/plugin-rolldown/helpers/resolve-options\";\nimport { resolveOptions as resolveRollupOptions } from \"@powerlines/plugin-rollup/helpers/resolve-options\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { ESBuildOptions } from \"vite\";\nimport { VitePluginResolvedConfig } from \"../types\";\nimport { ViteOptions } from \"../types/build\";\n\nexport const DEFAULT_VITE_CONFIG: Partial<ViteOptions> = {\n resolve: {\n extensions: [\".mjs\", \".js\", \".mts\", \".ts\", \".jsx\", \".tsx\", \".json\"]\n },\n json: {\n stringify: true\n },\n logLevel: \"silent\",\n clearScreen: true\n};\n\n/**\n * Resolves the options for [vite](https://vitejs.dev/).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): ViteOptions {\n return defu(\n {\n resolve: {\n alias: Object.entries(context.alias).reduce(\n (ret, [id, path]) => {\n if (!ret.find(e => e.find === id)) {\n ret.push({\n find: id,\n replacement: path\n });\n } else {\n context.warn(\n `Duplicate alias entry for '${id}' detected. The first entry will be used.`\n );\n }\n\n return ret;\n },\n [] as { find: string; replacement: string }[]\n ),\n dedupe: context.config.resolve.dedupe,\n mainFields: context.config.resolve.mainFields,\n conditions: context.config.resolve.conditions,\n extensions: context.config.resolve.extensions\n }\n },\n (context.config as VitePluginResolvedConfig).vite\n ? defu(\n (context.config as VitePluginResolvedConfig).vite,\n {\n optimizeDeps:\n (context.config as VitePluginResolvedConfig).vite?.optimizeDeps ??\n {}\n },\n {\n optimizeDeps: {\n extensions: context.config.resolve.extensions\n }\n }\n )\n : {},\n {\n define: context.config.define,\n rootDir: context.fs.existsSync(joinPaths(context.config.root, \"src\"))\n ? joinPaths(context.config.root, \"src\")\n : context.config.root,\n platform: context.config.platform,\n mode:\n context.config.mode === \"development\" ? \"development\" : \"production\",\n cacheDir: joinPaths(context.cachePath, \"vite\"),\n build: {\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\",\n outDir: context.config.output.buildPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n tsconfigRaw: context.tsconfig.tsconfigJson\n },\n esbuild: resolveEsbuildOptions(context) as ESBuildOptions,\n optimizeDeps: {\n rolldownOptions: resolveRolldownOptions(context),\n rollupOptions: resolveRollupOptions(context),\n esbuildOptions: resolveEsbuildOptions(context)\n },\n logLevel: context.config.logLevel ?? undefined,\n envDir: context.config.root\n } as ViteOptions,\n DEFAULT_VITE_CONFIG\n ) as ViteOptions;\n}\n"],"mappings":";;;;;;;AA4BA,MAAaA,sBAA4C;CACvD,SAAS,EACP,YAAY;EAAC;EAAQ;EAAO;EAAQ;EAAO;EAAQ;EAAQ;EAAQ,EACpE;CACD,MAAM,EACJ,WAAW,MACZ;CACD,UAAU;CACV,aAAa;CACd;;;;;;;AAQD,SAAgBC,iBAAe,SAA+B;AAC5D,QAAO,KACL,EACE,SAAS;EACP,OAAO,OAAO,QAAQ,QAAQ,MAAM,CAAC,QAClC,KAAK,CAAC,IAAI,UAAU;AACnB,OAAI,CAAC,IAAI,MAAK,MAAK,EAAE,SAAS,GAAG,CAC/B,KAAI,KAAK;IACP,MAAM;IACN,aAAa;IACd,CAAC;OAEF,SAAQ,KACN,8BAA8B,GAAG,2CAClC;AAGH,UAAO;KAET,EAAE,CACH;EACD,QAAQ,QAAQ,OAAO,QAAQ;EAC/B,YAAY,QAAQ,OAAO,QAAQ;EACnC,YAAY,QAAQ,OAAO,QAAQ;EACnC,YAAY,QAAQ,OAAO,QAAQ;EACpC,EACF,EACA,QAAQ,OAAoC,OACzC,KACG,QAAQ,OAAoC,MAC7C,EACE,cACG,QAAQ,OAAoC,MAAM,gBACnD,EAAE,EACL,EACD,EACE,cAAc,EACZ,YAAY,QAAQ,OAAO,QAAQ,YACpC,EACF,CACF,GACD,EAAE,EACN;EACE,QAAQ,QAAQ,OAAO;EACvB,SAAS,QAAQ,GAAG,WAAW,UAAU,QAAQ,OAAO,MAAM,MAAM,CAAC,GACjE,UAAU,QAAQ,OAAO,MAAM,MAAM,GACrC,QAAQ,OAAO;EACnB,UAAU,QAAQ,OAAO;EACzB,MACE,QAAQ,OAAO,SAAS,gBAAgB,gBAAgB;EAC1D,UAAU,UAAU,QAAQ,WAAW,OAAO;EAC9C,OAAO;GACL,QAAQ,QAAQ,OAAO,SAAS;GAChC,UAAU,QAAQ,OAAO,SAAS;GAClC,WAAW,QAAQ,OAAO,SAAS;GACnC,QAAQ,QAAQ,OAAO,OAAO;GAC9B,UAAU,QAAQ,SAAS;GAC3B,aAAa,QAAQ,SAAS;GAC/B;EACD,SAASC,eAAsB,QAAQ;EACvC,cAAc;GACZ,iBAAiBC,iBAAuB,QAAQ;GAChD,eAAeC,iBAAqB,QAAQ;GAC5C,gBAAgBF,eAAsB,QAAQ;GAC/C;EACD,UAAU,QAAQ,OAAO,YAAY;EACrC,QAAQ,QAAQ,OAAO;EACxB,EACD,oBACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options-D-xqROJb.d.mts","names":[],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;cA4Ba,qBAAqB,QAAQ;;AAA1C;AAiBA;;;;iBAAgB,cAAA,UAAwB,UAAU"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options-PlPrxfl4.d.cts","names":[],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;cA4Ba,qBAAqB,QAAQ;;AAA1C;AAiBA;;;;iBAAgB,cAAA,UAAwB,UAAU"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const require_resolve_options = require('./resolve-options-CGWH6O9W.cjs');
|
|
2
|
-
let __powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
|
|
3
|
-
let unplugin = require("unplugin");
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/unplugin.ts
|
|
6
|
-
function createVitePlugin(context) {
|
|
7
|
-
return (0, unplugin.createVitePlugin)((0, __powerlines_core_lib_unplugin.createUnplugin)(context))({});
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
//#endregion
|
|
11
|
-
Object.defineProperty(exports, 'createVitePlugin', {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () {
|
|
14
|
-
return createVitePlugin;
|
|
15
|
-
}
|
|
16
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { t as VitePluginContext } from "./plugin-BDnHvJzN.mjs";
|
|
2
|
-
import * as vite0 from "vite";
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/unplugin.d.ts
|
|
5
|
-
declare function createVitePlugin(context: VitePluginContext): vite0.Plugin<any> | vite0.Plugin<any>[];
|
|
6
|
-
//#endregion
|
|
7
|
-
export { createVitePlugin as t };
|
|
8
|
-
//# sourceMappingURL=unplugin-B_SxYRZq.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin-B_SxYRZq.d.mts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,gBAAA,UAA0B,oBAAiB,KAAA,CAAA,cAAA,KAAA,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createUnplugin } from "@powerlines/core/lib/unplugin";
|
|
2
|
-
import { createVitePlugin } from "unplugin";
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/unplugin.ts
|
|
5
|
-
function createVitePlugin$1(context) {
|
|
6
|
-
return createVitePlugin(createUnplugin(context))({});
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { createVitePlugin$1 as t };
|
|
11
|
-
//# sourceMappingURL=unplugin-CmW69N5s.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin-CmW69N5s.mjs","names":["createVitePlugin","createViteUnplugin"],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { createUnplugin } from \"@powerlines/core/lib/unplugin\";\nimport { createVitePlugin as createViteUnplugin } from \"unplugin\";\nimport { VitePluginContext } from \"../types/plugin\";\n\nexport function createVitePlugin(context: VitePluginContext) {\n return createViteUnplugin(createUnplugin(context))({});\n}\n"],"mappings":";;;;AAsBA,SAAgBA,mBAAiB,SAA4B;AAC3D,QAAOC,iBAAmB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { t as VitePluginContext } from "./plugin-BMA81Whw.cjs";
|
|
2
|
-
import * as vite0 from "vite";
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/unplugin.d.ts
|
|
5
|
-
declare function createVitePlugin(context: VitePluginContext): vite0.Plugin<any> | vite0.Plugin<any>[];
|
|
6
|
-
//#endregion
|
|
7
|
-
export { createVitePlugin as t };
|
|
8
|
-
//# sourceMappingURL=unplugin-dYAPcpXk.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin-dYAPcpXk.d.cts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,gBAAA,UAA0B,oBAAiB,KAAA,CAAA,cAAA,KAAA,CAAA"}
|