@octohash/vite-config 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1107 -0
- package/dist/index.mjs +628 -0
- package/package.json +29 -31
- package/dist/esm-shims-8z_NfQi2.js +0 -46
- package/dist/index.d.ts +0 -190
- package/dist/index.js +0 -497
- package/dist/vite-BZ52gTq1.js +0 -296671
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octohash/vite-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.3",
|
|
5
5
|
"description": "A personal ready-to-use Vite configuration repository, opinionated but customizable.",
|
|
6
6
|
"author": "jinghaihan",
|
|
7
7
|
"license": "MIT",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"vite-config"
|
|
19
19
|
],
|
|
20
20
|
"exports": {
|
|
21
|
-
".": "./dist/index.
|
|
21
|
+
".": "./dist/index.mjs",
|
|
22
22
|
"./package.json": "./package.json"
|
|
23
23
|
},
|
|
24
|
-
"main": "./dist/index.
|
|
25
|
-
"module": "./dist/index.
|
|
26
|
-
"types": "./dist/index.d.
|
|
24
|
+
"main": "./dist/index.mjs",
|
|
25
|
+
"module": "./dist/index.mjs",
|
|
26
|
+
"types": "./dist/index.d.mts",
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
@@ -31,22 +31,22 @@
|
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"vite": ">=6.0.0
|
|
34
|
+
"vite": ">=6.0.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@antfu/install-pkg": "^1.1.0",
|
|
38
38
|
"@clack/prompts": "^0.11.0",
|
|
39
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
40
|
-
"@vitejs/plugin-vue-jsx": "^5.
|
|
41
|
-
"dayjs": "^1.11.
|
|
39
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
40
|
+
"@vitejs/plugin-vue-jsx": "^5.1.1",
|
|
41
|
+
"dayjs": "^1.11.15",
|
|
42
42
|
"deepmerge": "^4.3.1",
|
|
43
43
|
"find-up": "^7.0.0",
|
|
44
|
-
"local-pkg": "^1.1.
|
|
45
|
-
"pkg-types": "^2.
|
|
44
|
+
"local-pkg": "^1.1.2",
|
|
45
|
+
"pkg-types": "^2.3.0",
|
|
46
46
|
"rollup-plugin-visualizer": "^6.0.3",
|
|
47
|
-
"unplugin-auto-import": "^
|
|
48
|
-
"unplugin-vue-components": "^
|
|
49
|
-
"unplugin-vue-router": "^0.
|
|
47
|
+
"unplugin-auto-import": "^20.1.0",
|
|
48
|
+
"unplugin-vue-components": "^29.0.0",
|
|
49
|
+
"unplugin-vue-router": "^0.15.0",
|
|
50
50
|
"vite-plugin-dts": "^4.5.4",
|
|
51
51
|
"vite-plugin-dynamic-base": "^1.2.0"
|
|
52
52
|
},
|
|
@@ -54,23 +54,22 @@
|
|
|
54
54
|
"@intlify/unplugin-vue-i18n": "^6.0.8",
|
|
55
55
|
"@originjs/vite-plugin-federation": "^1.4.1",
|
|
56
56
|
"vite-plugin-jspm": "^0.6.1",
|
|
57
|
-
"vite-plugin-vue-devtools": "^
|
|
57
|
+
"vite-plugin-vue-devtools": "^8.0.1"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@antfu/eslint-config": "^
|
|
61
|
-
"@jspm/generator": "^2.6.
|
|
62
|
-
"@octohash/tsconfig": "^0.
|
|
63
|
-
"@types/node": "^
|
|
64
|
-
"bumpp": "^10.2.
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"typescript": "^5.8.3",
|
|
60
|
+
"@antfu/eslint-config": "^5.2.1",
|
|
61
|
+
"@jspm/generator": "^2.6.4",
|
|
62
|
+
"@octohash/tsconfig": "^0.2.0",
|
|
63
|
+
"@types/node": "^24.3.0",
|
|
64
|
+
"bumpp": "^10.2.3",
|
|
65
|
+
"eslint": "^9.34.0",
|
|
66
|
+
"lint-staged": "^16.1.5",
|
|
67
|
+
"pncat": "^0.5.0",
|
|
68
|
+
"simple-git-hooks": "^2.13.1",
|
|
69
|
+
"taze": "^19.3.0",
|
|
70
|
+
"tinyglobby": "^0.2.14",
|
|
71
|
+
"typescript": "^5.9.2",
|
|
72
|
+
"unbuild": "^3.6.1",
|
|
74
73
|
"vitest": "^3.2.4"
|
|
75
74
|
},
|
|
76
75
|
"simple-git-hooks": {
|
|
@@ -80,11 +79,10 @@
|
|
|
80
79
|
"*": "eslint --fix"
|
|
81
80
|
},
|
|
82
81
|
"scripts": {
|
|
83
|
-
"build": "
|
|
82
|
+
"build": "unbuild",
|
|
84
83
|
"typecheck": "tsc",
|
|
85
84
|
"test": "vitest",
|
|
86
85
|
"lint": "eslint",
|
|
87
|
-
"commit": "czg",
|
|
88
86
|
"deps": "taze major -I",
|
|
89
87
|
"release": "bumpp && pnpm publish --no-git-checks",
|
|
90
88
|
"catalog": "pncat",
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
|
|
5
|
-
//#region rolldown:runtime
|
|
6
|
-
var __create = Object.create;
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __esm = (fn, res) => function() {
|
|
13
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
14
|
-
};
|
|
15
|
-
var __commonJS = (cb, mod) => function() {
|
|
16
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
20
|
-
key = keys[i];
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
22
|
-
get: ((k) => from[k]).bind(null, key),
|
|
23
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
-
value: mod,
|
|
31
|
-
enumerable: true
|
|
32
|
-
}) : target, mod));
|
|
33
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
36
|
-
//#region node_modules/.pnpm/tsdown@0.12.9_typescript@5.8.3/node_modules/tsdown/esm-shims.js
|
|
37
|
-
var getFilename, getDirname, __dirname, __filename;
|
|
38
|
-
var init_esm_shims = __esm({ "node_modules/.pnpm/tsdown@0.12.9_typescript@5.8.3/node_modules/tsdown/esm-shims.js"() {
|
|
39
|
-
getFilename = () => fileURLToPath(import.meta.url);
|
|
40
|
-
getDirname = () => path.dirname(getFilename());
|
|
41
|
-
__dirname = /* @__PURE__ */ getDirname();
|
|
42
|
-
__filename = /* @__PURE__ */ getFilename();
|
|
43
|
-
} });
|
|
44
|
-
|
|
45
|
-
//#endregion
|
|
46
|
-
export { __commonJS, __dirname, __filename, __reExport, __require, __toESM, init_esm_shims };
|
package/dist/index.d.ts
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import * as vite0 from "vite";
|
|
2
|
-
import { AliasOptions, PluginOption, UserConfig } from "vite";
|
|
3
|
-
import { PluginVisualizerOptions } from "rollup-plugin-visualizer";
|
|
4
|
-
import { PluginOptions } from "vite-plugin-dts";
|
|
5
|
-
import { VitePluginFederationOptions } from "@originjs/vite-plugin-federation";
|
|
6
|
-
import { VitePluginVueDevToolsOptions } from "vite-plugin-vue-devtools";
|
|
7
|
-
import { PluginOptions as PluginOptions$1 } from "@intlify/unplugin-vue-i18n";
|
|
8
|
-
import { Options } from "unplugin-auto-import/types";
|
|
9
|
-
import { Options as Options$1 } from "unplugin-vue-components";
|
|
10
|
-
import { Options as Options$2 } from "unplugin-vue-router";
|
|
11
|
-
import { GeneratorOptions } from "@jspm/generator";
|
|
12
|
-
|
|
13
|
-
//#region src/plugins/app-loading/index.d.ts
|
|
14
|
-
interface AppLoadingPluginOptions {
|
|
15
|
-
rootContainer?: string;
|
|
16
|
-
title?: string;
|
|
17
|
-
filePath?: string;
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/plugins/import-map.d.ts
|
|
21
|
-
interface ImportMapPluginOptions extends GeneratorOptions {
|
|
22
|
-
downloadDeps?: boolean;
|
|
23
|
-
debug?: boolean;
|
|
24
|
-
defaultProvider?: 'jspm.io' | 'jsdelivr' | 'unpkg' | 'esm.sh';
|
|
25
|
-
include?: string[];
|
|
26
|
-
exclude?: string[];
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/plugins/license.d.ts
|
|
30
|
-
interface LicensePluginOptions {
|
|
31
|
-
name?: string;
|
|
32
|
-
author?: string;
|
|
33
|
-
version?: string;
|
|
34
|
-
description?: string;
|
|
35
|
-
homepage?: string;
|
|
36
|
-
license?: string;
|
|
37
|
-
contact?: string;
|
|
38
|
-
copyright?: {
|
|
39
|
-
holder?: string;
|
|
40
|
-
year?: string | number;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region src/plugins/metadata.d.ts
|
|
45
|
-
interface MetadataPluginOptions {
|
|
46
|
-
extendMetadata?: Record<string, unknown>;
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/types.d.ts
|
|
50
|
-
type ProjectType = 'app' | 'lib';
|
|
51
|
-
interface CommonPluginOptions {
|
|
52
|
-
/**
|
|
53
|
-
* https://github.com/btd/rollup-plugin-visualizer
|
|
54
|
-
* By default template path is: ./node_modules/.cache/visualizer/stats.html
|
|
55
|
-
*
|
|
56
|
-
* @default false
|
|
57
|
-
*/
|
|
58
|
-
visualizer?: boolean | PluginVisualizerOptions;
|
|
59
|
-
/**
|
|
60
|
-
* Inject license info to output files
|
|
61
|
-
* Load license file from `package.json`, if it is a monorepo project, the root `package.json` will also be merged
|
|
62
|
-
*
|
|
63
|
-
* @default true
|
|
64
|
-
*/
|
|
65
|
-
license?: boolean | LicensePluginOptions;
|
|
66
|
-
/**
|
|
67
|
-
* https://github.com/originjs/vite-plugin-federation
|
|
68
|
-
* Module federation
|
|
69
|
-
*/
|
|
70
|
-
federation?: VitePluginFederationOptions;
|
|
71
|
-
}
|
|
72
|
-
interface AppPluginOptions {
|
|
73
|
-
/**
|
|
74
|
-
* https://github.com/chenxch/vite-plugin-dynamic-base
|
|
75
|
-
* If you want to build once and deploy to multiple environments, you can enable this plugin to set publicPath at runtime
|
|
76
|
-
* You can set like this: `dynamicBase: 'window.__dynamic_base__'`
|
|
77
|
-
*/
|
|
78
|
-
dynamicBase?: string;
|
|
79
|
-
/**
|
|
80
|
-
* Inject app loading to `index.html`
|
|
81
|
-
* You can customize the root element and loading template
|
|
82
|
-
* Use `[app-loading-title]` as a placeholder to dynamically set the document title during loading`
|
|
83
|
-
*
|
|
84
|
-
* @default auto-detect based on `projectType === 'app'`
|
|
85
|
-
*/
|
|
86
|
-
appLoading?: boolean | AppLoadingPluginOptions;
|
|
87
|
-
/**
|
|
88
|
-
* Injects metadata using `define`, accessible via `__VITE_APP_METADATA__`.
|
|
89
|
-
* Includes information such as author, build time, version, and more.
|
|
90
|
-
*
|
|
91
|
-
* @default auto-detect based on `projectType === 'app'`
|
|
92
|
-
*/
|
|
93
|
-
metadata?: boolean | MetadataPluginOptions;
|
|
94
|
-
/**
|
|
95
|
-
* Generates an import map for the project.
|
|
96
|
-
* Based on https://github.com/jspm/vite-plugin-jspm, with extended CDN provider support and options for include/exclude.
|
|
97
|
-
*
|
|
98
|
-
* @default false
|
|
99
|
-
*/
|
|
100
|
-
importMap?: boolean | ImportMapPluginOptions;
|
|
101
|
-
}
|
|
102
|
-
interface LibPluginOptions {
|
|
103
|
-
/**
|
|
104
|
-
* https://github.com/qmhc/vite-plugin-dts
|
|
105
|
-
* Generates declaration files from .ts or .vue source files
|
|
106
|
-
*
|
|
107
|
-
* @default auto-detect based on `projectType === 'lib'`
|
|
108
|
-
*/
|
|
109
|
-
dts?: boolean | PluginOptions;
|
|
110
|
-
}
|
|
111
|
-
interface OptionsVue {
|
|
112
|
-
/**
|
|
113
|
-
* https://github.com/vuejs/devtools
|
|
114
|
-
* Enable Vue Devtools
|
|
115
|
-
*
|
|
116
|
-
* @default false
|
|
117
|
-
*/
|
|
118
|
-
devtools?: boolean | VitePluginVueDevToolsOptions;
|
|
119
|
-
/**
|
|
120
|
-
* https://github.com/intlify/bundle-tools
|
|
121
|
-
* Enable Vue I18n
|
|
122
|
-
*
|
|
123
|
-
* @default false
|
|
124
|
-
*/
|
|
125
|
-
i18n?: boolean | PluginOptions$1;
|
|
126
|
-
/**
|
|
127
|
-
* https://github.com/unplugin/unplugin-auto-import
|
|
128
|
-
* Auto-imports commonly used APIs such as `vue`, `vue-router`, `pinia`, `@vueuse/core`, etc
|
|
129
|
-
* Also supports auto-importing UI components from libraries like `ant-design-vue`, `element-plus`, etc
|
|
130
|
-
* Files from `src/composables` and `src/utils` will also be auto-imported.
|
|
131
|
-
*
|
|
132
|
-
* @default auto-detect based on `projectType === 'app'`
|
|
133
|
-
*/
|
|
134
|
-
imports?: boolean | Options;
|
|
135
|
-
/**
|
|
136
|
-
* https://github.com/unplugin/unplugin-vue-components
|
|
137
|
-
* Enabled by default when the project type is `app`
|
|
138
|
-
* The `directoryAsNamespace` option is enabled by default.
|
|
139
|
-
*
|
|
140
|
-
* @default auto-detect based on `projectType === 'app'`
|
|
141
|
-
*/
|
|
142
|
-
components?: boolean | Options$1;
|
|
143
|
-
/**
|
|
144
|
-
* https://github.com/posva/unplugin-vue-router
|
|
145
|
-
* Enabled by default when the project type is `app`
|
|
146
|
-
* Folder(s) to scan for files and generate routes. Defaults to scanning the pages directory.
|
|
147
|
-
*
|
|
148
|
-
* @default auto-detect based on `projectType === 'app'`
|
|
149
|
-
*/
|
|
150
|
-
pages?: boolean | Options$2;
|
|
151
|
-
}
|
|
152
|
-
interface OptionsConfig extends CommonPluginOptions, AppPluginOptions, LibPluginOptions {
|
|
153
|
-
/**
|
|
154
|
-
* Whether to build for production
|
|
155
|
-
*
|
|
156
|
-
* @default auto-detect based on `command === 'build'`
|
|
157
|
-
*/
|
|
158
|
-
isBuild?: boolean;
|
|
159
|
-
/**
|
|
160
|
-
* Type of the project
|
|
161
|
-
*
|
|
162
|
-
* @default auto-detect based on the `index.html` file
|
|
163
|
-
*/
|
|
164
|
-
type?: ProjectType;
|
|
165
|
-
/**
|
|
166
|
-
* Aliases used to replace values in `import` or `require` statements
|
|
167
|
-
* Paths are automatically resolved if needed
|
|
168
|
-
*
|
|
169
|
-
* @default { "@": "./src" }
|
|
170
|
-
*/
|
|
171
|
-
alias?: AliasOptions;
|
|
172
|
-
/**
|
|
173
|
-
* Enable Vue support
|
|
174
|
-
* The goal is to provide an automatic registration mechanism similar to Nuxt in app development.
|
|
175
|
-
*
|
|
176
|
-
* @default auto-detect based on the dependencies
|
|
177
|
-
*/
|
|
178
|
-
vue?: boolean | OptionsVue;
|
|
179
|
-
vite?: UserConfig;
|
|
180
|
-
}
|
|
181
|
-
interface ConditionPlugin {
|
|
182
|
-
condition?: boolean;
|
|
183
|
-
plugins: () => PluginOption[] | PromiseLike<PluginOption[]>;
|
|
184
|
-
}
|
|
185
|
-
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
186
|
-
//#endregion
|
|
187
|
-
//#region src/index.d.ts
|
|
188
|
-
declare function defineConfig(options: OptionsConfig): vite0.UserConfigFnPromise;
|
|
189
|
-
//#endregion
|
|
190
|
-
export { AppPluginOptions, CommonPluginOptions, ConditionPlugin, LibPluginOptions, OptionsConfig, OptionsVue, ProjectType, ResolvedOptions, defineConfig };
|