@sybz-components/utils 1.0.15 → 1.0.16
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/base.cjs +1 -1
- package/dist/base.mjs +1 -1
- package/dist/format.cjs +1 -1
- package/dist/format.mjs +1 -1
- package/dist/http.cjs +1 -1
- package/dist/http.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{utils.2cNhEypm.mjs → utils.BVs9MJTE.mjs} +1 -1
- package/dist/shared/{utils.RNNXtrF5.cjs → utils.KWmfSH7h.cjs} +1 -1
- package/dist/sybz-code-standard.cjs +44 -9
- package/dist/sybz-code-standard.mjs +46 -11
- package/dist/vite.cjs +31 -0
- package/dist/vite.d.cts +2 -0
- package/dist/vite.d.mts +2 -0
- package/dist/vite.d.ts +2 -0
- package/dist/vite.mjs +30 -0
- package/package.json +1 -1
package/dist/base.cjs
CHANGED
package/dist/base.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'vue';
|
|
2
2
|
import 'consola';
|
|
3
3
|
import 'es-toolkit';
|
|
4
|
-
export { $ as $toast, c as clearStorage, a as clone, b as configureUtils, d as confirm, e as copy, f as debounce, g as delay, h as getStorage, i as getType, j as getUtilsBuildTime, k as getVariable, l as isEmpty, m as log, n as merge, o as mockValue, p as processWidth, r as random, s as setStorage, t as test, q as throttle, u as toLine, v as tryCatch, w as validate, x as validateForm, y as validateOnSubmit } from './shared/utils.
|
|
4
|
+
export { $ as $toast, c as clearStorage, a as clone, b as configureUtils, d as confirm, e as copy, f as debounce, g as delay, h as getStorage, i as getType, j as getUtilsBuildTime, k as getVariable, l as isEmpty, m as log, n as merge, o as mockValue, p as processWidth, r as random, s as setStorage, t as test, q as throttle, u as toLine, v as tryCatch, w as validate, x as validateForm, y as validateOnSubmit } from './shared/utils.BVs9MJTE.mjs';
|
|
5
5
|
import './confirmSemantic.mjs';
|
|
6
6
|
import 'element-plus';
|
|
7
7
|
import 'axios';
|
package/dist/format.cjs
CHANGED
package/dist/format.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { z as formatBytes, A as formatBytesConvert, B as formatDurationTime, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed } from './shared/utils.
|
|
1
|
+
export { z as formatBytes, A as formatBytesConvert, B as formatDurationTime, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed } from './shared/utils.BVs9MJTE.mjs';
|
|
2
2
|
import './is.mjs';
|
|
3
3
|
import 'consola';
|
|
4
4
|
import 'vue';
|
package/dist/http.cjs
CHANGED
package/dist/http.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'axios';
|
|
2
|
-
export { H as HttpError, G as configureHttp, I as createHttp, J as http } from './shared/utils.
|
|
2
|
+
export { H as HttpError, G as configureHttp, I as createHttp, J as http } from './shared/utils.BVs9MJTE.mjs';
|
|
3
3
|
import 'vue';
|
|
4
4
|
import 'consola';
|
|
5
5
|
import 'es-toolkit';
|
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { $ as $toast, H as HttpError, c as clearStorage, a as clone, G as configureHttp, b as configureUtils, d as confirm, e as copy, I as createHttp, f as debounce, g as delay, z as formatBytes, A as formatBytesConvert, B as formatDurationTime, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed, h as getStorage, i as getType, j as getUtilsBuildTime, k as getVariable, J as http, l as isEmpty, m as log, n as merge, o as mockValue, p as processWidth, r as random, s as setStorage, t as test, q as throttle, u as toLine, v as tryCatch, w as validate, x as validateForm, y as validateOnSubmit } from './shared/utils.
|
|
1
|
+
export { $ as $toast, H as HttpError, c as clearStorage, a as clone, G as configureHttp, b as configureUtils, d as confirm, e as copy, I as createHttp, f as debounce, g as delay, z as formatBytes, A as formatBytesConvert, B as formatDurationTime, C as formatTextToHtml, D as formatThousands, E as formatTime, F as formatToFixed, h as getStorage, i as getType, j as getUtilsBuildTime, k as getVariable, J as http, l as isEmpty, m as log, n as merge, o as mockValue, p as processWidth, r as random, s as setStorage, t as test, q as throttle, u as toLine, v as tryCatch, w as validate, x as validateForm, y as validateOnSubmit } from './shared/utils.BVs9MJTE.mjs';
|
|
2
2
|
export { resolveConfirmSemantic } from './confirmSemantic.mjs';
|
|
3
3
|
export { isArray, isBoolean, isComponent, isDate, isEmptyObject, isFunction, isIOS, isMap, isNumber, isObject, isPlainObject, isPromise, isRegExp, isSVGElement, isSet, isString, isStringNumber, isSymbol, isUrl, objectToString, toRawType, toTypeString } from './is.mjs';
|
|
4
4
|
export { SYBZ_THEME_PREFIX, isSybzTheme, resolveSybzComponentTheme } from './theme.mjs';
|
|
@@ -1196,7 +1196,7 @@ function getVariable(propertyName, fallback = "") {
|
|
|
1196
1196
|
const DEFAULT_BUILD_TIME_FALLBACK = "\u672A\u6CE8\u5165";
|
|
1197
1197
|
function getUtilsBuildTime(fallback = DEFAULT_BUILD_TIME_FALLBACK) {
|
|
1198
1198
|
{
|
|
1199
|
-
return "2026-
|
|
1199
|
+
return "2026-10-22 09:49:58";
|
|
1200
1200
|
}
|
|
1201
1201
|
}
|
|
1202
1202
|
function test() {
|
|
@@ -1202,7 +1202,7 @@ function getVariable(propertyName, fallback = "") {
|
|
|
1202
1202
|
const DEFAULT_BUILD_TIME_FALLBACK = "\u672A\u6CE8\u5165";
|
|
1203
1203
|
function getUtilsBuildTime(fallback = DEFAULT_BUILD_TIME_FALLBACK) {
|
|
1204
1204
|
{
|
|
1205
|
-
return "2026-
|
|
1205
|
+
return "2026-10-22 09:49:58";
|
|
1206
1206
|
}
|
|
1207
1207
|
}
|
|
1208
1208
|
function test() {
|
|
@@ -90,24 +90,59 @@ const configurePackageJson = (force) => {
|
|
|
90
90
|
`, "utf8");
|
|
91
91
|
console.log("\u66F4\u65B0 package.json scripts");
|
|
92
92
|
};
|
|
93
|
+
const gitRoot = () => {
|
|
94
|
+
try {
|
|
95
|
+
return node_child_process.execFileSync("git", ["rev-parse", "--show-toplevel"], { cwd, encoding: "utf8" }).trim();
|
|
96
|
+
} catch {
|
|
97
|
+
throw new Error(`\u5F53\u524D\u76EE\u5F55\u4E0D\u5728 Git \u4ED3\u5E93\u4E2D\uFF0C\u65E0\u6CD5\u5B89\u88C5 Husky\uFF1A${cwd}`);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
93
100
|
const prepareHusky = () => {
|
|
94
|
-
const
|
|
95
|
-
|
|
101
|
+
const root = gitRoot();
|
|
102
|
+
const original = process.cwd();
|
|
103
|
+
try {
|
|
104
|
+
process.chdir(root);
|
|
105
|
+
const result = husky__default();
|
|
106
|
+
if (result && result !== "HUSKY=0 skip install") throw new Error(`Husky \u5B89\u88C5\u5931\u8D25\uFF1A${result}`);
|
|
107
|
+
if (result) console.warn(result);
|
|
108
|
+
} finally {
|
|
109
|
+
process.chdir(original);
|
|
110
|
+
}
|
|
111
|
+
return root;
|
|
96
112
|
};
|
|
113
|
+
const shellQuote = (value) => `'${value.replaceAll("'", "'\\''")}'`;
|
|
97
114
|
const configurePreCommit = () => {
|
|
98
|
-
prepareHusky();
|
|
99
|
-
const
|
|
115
|
+
const root = prepareHusky();
|
|
116
|
+
const projectPath = node_path.relative(root, cwd);
|
|
117
|
+
const huskyDir = node_path.resolve(root, ".husky");
|
|
100
118
|
const hookPath = node_path.resolve(huskyDir, "pre-commit");
|
|
101
|
-
const
|
|
119
|
+
const oldCommand = "pnpm exec sybz-code-standard staged";
|
|
120
|
+
const command2 = projectPath ? `pnpm --dir ${shellQuote(projectPath)} exec sybz-code-standard staged` : oldCommand;
|
|
102
121
|
node_fs.mkdirSync(huskyDir, { recursive: true });
|
|
103
122
|
const current = node_fs.existsSync(hookPath) ? node_fs.readFileSync(hookPath, "utf8").trimEnd() : "";
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
123
|
+
const lines = current ? current.split("\n") : [];
|
|
124
|
+
if (!lines.some((line) => line.trim() === command2)) {
|
|
125
|
+
const oldIndex = lines.findIndex((line) => line.trim() === oldCommand);
|
|
126
|
+
if (oldIndex >= 0) lines[oldIndex] = command2;
|
|
127
|
+
else lines.push(command2);
|
|
128
|
+
node_fs.writeFileSync(hookPath, `${lines.join("\n")}
|
|
107
129
|
`, { encoding: "utf8", mode: 493 });
|
|
108
|
-
|
|
130
|
+
console.log(`\u66F4\u65B0 ${node_path.relative(root, hookPath)}`);
|
|
131
|
+
}
|
|
132
|
+
if (projectPath) {
|
|
133
|
+
const obsoleteDir = node_path.resolve(cwd, ".husky");
|
|
134
|
+
const obsoleteHook = node_path.resolve(obsoleteDir, "pre-commit");
|
|
135
|
+
if (node_fs.existsSync(obsoleteHook) && node_fs.readFileSync(obsoleteHook, "utf8").trim() === oldCommand) {
|
|
136
|
+
node_fs.unlinkSync(obsoleteHook);
|
|
137
|
+
try {
|
|
138
|
+
node_fs.rmdirSync(obsoleteDir);
|
|
139
|
+
} catch {
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
109
143
|
};
|
|
110
144
|
const init = (args2) => {
|
|
145
|
+
gitRoot();
|
|
111
146
|
const force = args2.includes("--force");
|
|
112
147
|
configurePackageJson(force);
|
|
113
148
|
for (const [filePath, content] of Object.entries(generatedFiles)) writeConfigFile(filePath, content, force);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { execFileSync } from 'node:child_process';
|
|
3
|
-
import { existsSync, readFileSync, writeFileSync, mkdirSync, copyFileSync } from 'node:fs';
|
|
3
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync, rmdirSync, copyFileSync } from 'node:fs';
|
|
4
4
|
import { createRequire } from 'node:module';
|
|
5
|
-
import { resolve } from 'node:path';
|
|
5
|
+
import { resolve, relative } from 'node:path';
|
|
6
6
|
import husky from 'husky';
|
|
7
7
|
|
|
8
8
|
const cwd = process.cwd();
|
|
@@ -83,24 +83,59 @@ const configurePackageJson = (force) => {
|
|
|
83
83
|
`, "utf8");
|
|
84
84
|
console.log("\u66F4\u65B0 package.json scripts");
|
|
85
85
|
};
|
|
86
|
+
const gitRoot = () => {
|
|
87
|
+
try {
|
|
88
|
+
return execFileSync("git", ["rev-parse", "--show-toplevel"], { cwd, encoding: "utf8" }).trim();
|
|
89
|
+
} catch {
|
|
90
|
+
throw new Error(`\u5F53\u524D\u76EE\u5F55\u4E0D\u5728 Git \u4ED3\u5E93\u4E2D\uFF0C\u65E0\u6CD5\u5B89\u88C5 Husky\uFF1A${cwd}`);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
86
93
|
const prepareHusky = () => {
|
|
87
|
-
const
|
|
88
|
-
|
|
94
|
+
const root = gitRoot();
|
|
95
|
+
const original = process.cwd();
|
|
96
|
+
try {
|
|
97
|
+
process.chdir(root);
|
|
98
|
+
const result = husky();
|
|
99
|
+
if (result && result !== "HUSKY=0 skip install") throw new Error(`Husky \u5B89\u88C5\u5931\u8D25\uFF1A${result}`);
|
|
100
|
+
if (result) console.warn(result);
|
|
101
|
+
} finally {
|
|
102
|
+
process.chdir(original);
|
|
103
|
+
}
|
|
104
|
+
return root;
|
|
89
105
|
};
|
|
106
|
+
const shellQuote = (value) => `'${value.replaceAll("'", "'\\''")}'`;
|
|
90
107
|
const configurePreCommit = () => {
|
|
91
|
-
prepareHusky();
|
|
92
|
-
const
|
|
108
|
+
const root = prepareHusky();
|
|
109
|
+
const projectPath = relative(root, cwd);
|
|
110
|
+
const huskyDir = resolve(root, ".husky");
|
|
93
111
|
const hookPath = resolve(huskyDir, "pre-commit");
|
|
94
|
-
const
|
|
112
|
+
const oldCommand = "pnpm exec sybz-code-standard staged";
|
|
113
|
+
const command2 = projectPath ? `pnpm --dir ${shellQuote(projectPath)} exec sybz-code-standard staged` : oldCommand;
|
|
95
114
|
mkdirSync(huskyDir, { recursive: true });
|
|
96
115
|
const current = existsSync(hookPath) ? readFileSync(hookPath, "utf8").trimEnd() : "";
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
116
|
+
const lines = current ? current.split("\n") : [];
|
|
117
|
+
if (!lines.some((line) => line.trim() === command2)) {
|
|
118
|
+
const oldIndex = lines.findIndex((line) => line.trim() === oldCommand);
|
|
119
|
+
if (oldIndex >= 0) lines[oldIndex] = command2;
|
|
120
|
+
else lines.push(command2);
|
|
121
|
+
writeFileSync(hookPath, `${lines.join("\n")}
|
|
100
122
|
`, { encoding: "utf8", mode: 493 });
|
|
101
|
-
|
|
123
|
+
console.log(`\u66F4\u65B0 ${relative(root, hookPath)}`);
|
|
124
|
+
}
|
|
125
|
+
if (projectPath) {
|
|
126
|
+
const obsoleteDir = resolve(cwd, ".husky");
|
|
127
|
+
const obsoleteHook = resolve(obsoleteDir, "pre-commit");
|
|
128
|
+
if (existsSync(obsoleteHook) && readFileSync(obsoleteHook, "utf8").trim() === oldCommand) {
|
|
129
|
+
unlinkSync(obsoleteHook);
|
|
130
|
+
try {
|
|
131
|
+
rmdirSync(obsoleteDir);
|
|
132
|
+
} catch {
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
102
136
|
};
|
|
103
137
|
const init = (args2) => {
|
|
138
|
+
gitRoot();
|
|
104
139
|
const force = args2.includes("--force");
|
|
105
140
|
configurePackageJson(force);
|
|
106
141
|
for (const [filePath, content] of Object.entries(generatedFiles)) writeConfigFile(filePath, content, force);
|
package/dist/vite.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const node_module = require('node:module');
|
|
3
4
|
const codeInspectorPlugin = require('code-inspector-plugin');
|
|
4
5
|
const tailwindcss = require('@tailwindcss/vite');
|
|
5
6
|
const vueJsx = require('@vitejs/plugin-vue-jsx');
|
|
@@ -8,11 +9,40 @@ require('node:child_process');
|
|
|
8
9
|
require('node:fs');
|
|
9
10
|
require('node:path');
|
|
10
11
|
|
|
12
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
11
13
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
12
14
|
|
|
13
15
|
const tailwindcss__default = /*#__PURE__*/_interopDefaultCompat(tailwindcss);
|
|
14
16
|
const vueJsx__default = /*#__PURE__*/_interopDefaultCompat(vueJsx);
|
|
15
17
|
|
|
18
|
+
const require2 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vite.cjs', document.baseURI).href)));
|
|
19
|
+
const virtualTailwindId = "virtual:sybz-tailwind";
|
|
20
|
+
const resolvedVirtualTailwindId = `\0${virtualTailwindId}`;
|
|
21
|
+
const createTailwindEntry = () => {
|
|
22
|
+
const tailwindCssPath = require2.resolve("tailwindcss/index.css");
|
|
23
|
+
return {
|
|
24
|
+
name: "sybz-tailwind-entry",
|
|
25
|
+
resolveId(id) {
|
|
26
|
+
if (id === virtualTailwindId) return resolvedVirtualTailwindId;
|
|
27
|
+
},
|
|
28
|
+
load(id) {
|
|
29
|
+
if (id === resolvedVirtualTailwindId) return `import ${JSON.stringify(tailwindCssPath)}`;
|
|
30
|
+
},
|
|
31
|
+
transformIndexHtml: {
|
|
32
|
+
order: "pre",
|
|
33
|
+
handler() {
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
tag: "script",
|
|
37
|
+
attrs: { type: "module" },
|
|
38
|
+
children: `import '${virtualTailwindId}'`,
|
|
39
|
+
injectTo: "head-prepend"
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
};
|
|
16
46
|
const createCodeInspector = (options = {}) => codeInspectorPlugin.codeInspectorPlugin({ editor: "code", ...options, bundler: "vite" });
|
|
17
47
|
const formatBuildTime = (date) => {
|
|
18
48
|
const pad = (value) => String(value).padStart(2, "0");
|
|
@@ -50,6 +80,7 @@ const sybzVitePlugins = (options = {}) => {
|
|
|
50
80
|
}
|
|
51
81
|
if (options.tailwind !== false) {
|
|
52
82
|
plugins.push(...tailwindcss__default(typeof options.tailwind === "object" ? options.tailwind : {}));
|
|
83
|
+
if (options.tailwindCss !== false) plugins.push(createTailwindEntry());
|
|
53
84
|
}
|
|
54
85
|
if (options.codeInspector !== false) {
|
|
55
86
|
plugins.push(createCodeInspector(typeof options.codeInspector === "object" ? options.codeInspector : {}));
|
package/dist/vite.d.cts
CHANGED
|
@@ -15,6 +15,8 @@ interface SybzVitePluginsOptions {
|
|
|
15
15
|
vueJsx?: boolean | Options;
|
|
16
16
|
/** Tailwind CSS v4 Vite 插件配置;默认启用,设为 false 时关闭。 */
|
|
17
17
|
tailwind?: boolean | PluginOptions;
|
|
18
|
+
/** 自动向 HTML 注入 Tailwind CSS;默认启用,已有手动 CSS 入口时可设为 false。 */
|
|
19
|
+
tailwindCss?: boolean;
|
|
18
20
|
/** 代码定位插件配置;默认启用,设为 false 时关闭。 */
|
|
19
21
|
codeInspector?: boolean | SybzCodeInspectorOptions;
|
|
20
22
|
/** Git 提交信息插件配置;默认启用,设为 false 时关闭。 */
|
package/dist/vite.d.mts
CHANGED
|
@@ -15,6 +15,8 @@ interface SybzVitePluginsOptions {
|
|
|
15
15
|
vueJsx?: boolean | Options;
|
|
16
16
|
/** Tailwind CSS v4 Vite 插件配置;默认启用,设为 false 时关闭。 */
|
|
17
17
|
tailwind?: boolean | PluginOptions;
|
|
18
|
+
/** 自动向 HTML 注入 Tailwind CSS;默认启用,已有手动 CSS 入口时可设为 false。 */
|
|
19
|
+
tailwindCss?: boolean;
|
|
18
20
|
/** 代码定位插件配置;默认启用,设为 false 时关闭。 */
|
|
19
21
|
codeInspector?: boolean | SybzCodeInspectorOptions;
|
|
20
22
|
/** Git 提交信息插件配置;默认启用,设为 false 时关闭。 */
|
package/dist/vite.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ interface SybzVitePluginsOptions {
|
|
|
15
15
|
vueJsx?: boolean | Options;
|
|
16
16
|
/** Tailwind CSS v4 Vite 插件配置;默认启用,设为 false 时关闭。 */
|
|
17
17
|
tailwind?: boolean | PluginOptions;
|
|
18
|
+
/** 自动向 HTML 注入 Tailwind CSS;默认启用,已有手动 CSS 入口时可设为 false。 */
|
|
19
|
+
tailwindCss?: boolean;
|
|
18
20
|
/** 代码定位插件配置;默认启用,设为 false 时关闭。 */
|
|
19
21
|
codeInspector?: boolean | SybzCodeInspectorOptions;
|
|
20
22
|
/** Git 提交信息插件配置;默认启用,设为 false 时关闭。 */
|
package/dist/vite.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
1
2
|
import { codeInspectorPlugin } from 'code-inspector-plugin';
|
|
2
3
|
import tailwindcss from '@tailwindcss/vite';
|
|
3
4
|
import vueJsx from '@vitejs/plugin-vue-jsx';
|
|
@@ -6,6 +7,34 @@ import 'node:child_process';
|
|
|
6
7
|
import 'node:fs';
|
|
7
8
|
import 'node:path';
|
|
8
9
|
|
|
10
|
+
const require2 = createRequire(import.meta.url);
|
|
11
|
+
const virtualTailwindId = "virtual:sybz-tailwind";
|
|
12
|
+
const resolvedVirtualTailwindId = `\0${virtualTailwindId}`;
|
|
13
|
+
const createTailwindEntry = () => {
|
|
14
|
+
const tailwindCssPath = require2.resolve("tailwindcss/index.css");
|
|
15
|
+
return {
|
|
16
|
+
name: "sybz-tailwind-entry",
|
|
17
|
+
resolveId(id) {
|
|
18
|
+
if (id === virtualTailwindId) return resolvedVirtualTailwindId;
|
|
19
|
+
},
|
|
20
|
+
load(id) {
|
|
21
|
+
if (id === resolvedVirtualTailwindId) return `import ${JSON.stringify(tailwindCssPath)}`;
|
|
22
|
+
},
|
|
23
|
+
transformIndexHtml: {
|
|
24
|
+
order: "pre",
|
|
25
|
+
handler() {
|
|
26
|
+
return [
|
|
27
|
+
{
|
|
28
|
+
tag: "script",
|
|
29
|
+
attrs: { type: "module" },
|
|
30
|
+
children: `import '${virtualTailwindId}'`,
|
|
31
|
+
injectTo: "head-prepend"
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
};
|
|
9
38
|
const createCodeInspector = (options = {}) => codeInspectorPlugin({ editor: "code", ...options, bundler: "vite" });
|
|
10
39
|
const formatBuildTime = (date) => {
|
|
11
40
|
const pad = (value) => String(value).padStart(2, "0");
|
|
@@ -43,6 +72,7 @@ const sybzVitePlugins = (options = {}) => {
|
|
|
43
72
|
}
|
|
44
73
|
if (options.tailwind !== false) {
|
|
45
74
|
plugins.push(...tailwindcss(typeof options.tailwind === "object" ? options.tailwind : {}));
|
|
75
|
+
if (options.tailwindCss !== false) plugins.push(createTailwindEntry());
|
|
46
76
|
}
|
|
47
77
|
if (options.codeInspector !== false) {
|
|
48
78
|
plugins.push(createCodeInspector(typeof options.codeInspector === "object" ? options.codeInspector : {}));
|