@vixt/uni 0.5.4 → 0.5.6
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 +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.mjs +13 -3
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
+
import { ResolvedConfig } from 'vite';
|
|
2
3
|
import * as _vixt_core from '@vixt/core';
|
|
3
4
|
import { AppOptions, Vixt, PluginOptions as PluginOptions$1, VixtOptions } from '@vixt/core';
|
|
4
5
|
import Pages, { PageMetaDatum } from '@uni-helper/vite-plugin-uni-pages';
|
|
@@ -73,11 +74,16 @@ declare function transformMpRuntime(code: string, id: string): string;
|
|
|
73
74
|
declare function transformH5Runtime(code: string, id: string): string;
|
|
74
75
|
/** 移除路径中的'../' */
|
|
75
76
|
declare function patchNormalizeNodeModules(): void;
|
|
77
|
+
/**
|
|
78
|
+
* 兼容 unocss^66.1.0 小程序平台的css文件后缀名
|
|
79
|
+
* @see https://github.com/dcloudio/uni-app/pull/5605/files
|
|
80
|
+
*/
|
|
81
|
+
declare function patchAdjustCssExtname(config: ResolvedConfig): void;
|
|
76
82
|
declare const uniPatch: (options?: any) => vite.PluginOption;
|
|
77
83
|
|
|
78
84
|
declare function uniVueUseResolver(): ImportsMap;
|
|
79
85
|
|
|
80
86
|
declare const _default: (options?: _vixt_core.VixtOptions | undefined) => vite.PluginOption;
|
|
81
87
|
|
|
82
|
-
export { appUni, _default as default, generateMainTs, patchNormalizeNodeModules, presetUni, transformH5Runtime, transformMpRuntime, uniModules, uniPatch, uniVueUseResolver };
|
|
88
|
+
export { appUni, _default as default, generateMainTs, patchAdjustCssExtname, patchNormalizeNodeModules, presetUni, transformH5Runtime, transformMpRuntime, uniModules, uniPatch, uniVueUseResolver };
|
|
83
89
|
export type { ModuleOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
+
import { ResolvedConfig } from 'vite';
|
|
2
3
|
import * as _vixt_core from '@vixt/core';
|
|
3
4
|
import { AppOptions, Vixt, PluginOptions as PluginOptions$1, VixtOptions } from '@vixt/core';
|
|
4
5
|
import Pages, { PageMetaDatum } from '@uni-helper/vite-plugin-uni-pages';
|
|
@@ -73,11 +74,16 @@ declare function transformMpRuntime(code: string, id: string): string;
|
|
|
73
74
|
declare function transformH5Runtime(code: string, id: string): string;
|
|
74
75
|
/** 移除路径中的'../' */
|
|
75
76
|
declare function patchNormalizeNodeModules(): void;
|
|
77
|
+
/**
|
|
78
|
+
* 兼容 unocss^66.1.0 小程序平台的css文件后缀名
|
|
79
|
+
* @see https://github.com/dcloudio/uni-app/pull/5605/files
|
|
80
|
+
*/
|
|
81
|
+
declare function patchAdjustCssExtname(config: ResolvedConfig): void;
|
|
76
82
|
declare const uniPatch: (options?: any) => vite.PluginOption;
|
|
77
83
|
|
|
78
84
|
declare function uniVueUseResolver(): ImportsMap;
|
|
79
85
|
|
|
80
86
|
declare const _default: (options?: _vixt_core.VixtOptions | undefined) => vite.PluginOption;
|
|
81
87
|
|
|
82
|
-
export { appUni, _default as default, generateMainTs, patchNormalizeNodeModules, presetUni, transformH5Runtime, transformMpRuntime, uniModules, uniPatch, uniVueUseResolver };
|
|
88
|
+
export { appUni, _default as default, generateMainTs, patchAdjustCssExtname, patchNormalizeNodeModules, presetUni, transformH5Runtime, transformMpRuntime, uniModules, uniPatch, uniVueUseResolver };
|
|
83
89
|
export type { ModuleOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { generateClient, generateCss, generateAppConfig, generatePlugins, defineVixtModule, generateIndexHtml, defineVitePlugin, resolveLayersDirs,
|
|
1
|
+
import { generateClient, generateCss, generateAppConfig, generatePlugins, defineVixtModule, generateIndexHtml, defineVitePlugin, resolveLayersDirs, createVixtPlugin } from '@vixt/core';
|
|
2
2
|
import path from 'pathe';
|
|
3
3
|
import { genarateAppComponent } from '@vixt/vue';
|
|
4
4
|
import fs from 'fs-extra';
|
|
@@ -131,10 +131,21 @@ function patchNormalizeNodeModules() {
|
|
|
131
131
|
fs.writeFileSync(codePath, code);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
+
function patchAdjustCssExtname(config) {
|
|
135
|
+
const plugin = config.plugins.find((p) => p.name === "uni:adjust-css-extname");
|
|
136
|
+
if (plugin && typeof plugin.generateBundle === "function") {
|
|
137
|
+
const handler = plugin.generateBundle;
|
|
138
|
+
plugin.generateBundle = { order: "post", handler };
|
|
139
|
+
}
|
|
140
|
+
}
|
|
134
141
|
const uniPatch = defineVitePlugin(() => {
|
|
135
142
|
patchNormalizeNodeModules();
|
|
136
143
|
return {
|
|
137
144
|
name: "vixt:uni-patch",
|
|
145
|
+
enforce: "post",
|
|
146
|
+
configResolved(config) {
|
|
147
|
+
patchAdjustCssExtname(config);
|
|
148
|
+
},
|
|
138
149
|
transform(code, id) {
|
|
139
150
|
code = transformMpRuntime(code, id);
|
|
140
151
|
code = transformH5Runtime(code, id);
|
|
@@ -202,7 +213,6 @@ const presetUni = defineVixtModule({
|
|
|
202
213
|
unocss: {}
|
|
203
214
|
};
|
|
204
215
|
const options = vixt.options = defu(vixt.options, defaultOptions);
|
|
205
|
-
patchUnocss();
|
|
206
216
|
const modules = [
|
|
207
217
|
Pages(options.uniPages),
|
|
208
218
|
Layouts(options.uniLayouts),
|
|
@@ -279,4 +289,4 @@ const defaults = {
|
|
|
279
289
|
};
|
|
280
290
|
const index = createVixtPlugin({ defaults });
|
|
281
291
|
|
|
282
|
-
export { appUni, index as default, generateMainTs, patchNormalizeNodeModules, presetUni, transformH5Runtime, transformMpRuntime, uniModules, uniPatch, uniVueUseResolver };
|
|
292
|
+
export { appUni, index as default, generateMainTs, patchAdjustCssExtname, patchNormalizeNodeModules, presetUni, transformH5Runtime, transformMpRuntime, uniModules, uniPatch, uniVueUseResolver };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vixt/uni",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.6",
|
|
5
5
|
"author": "SoulLyoko<https://github.com/SoulLyoko>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://soullyoko.github.io/vixt/",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"@uni-helper/vite-plugin-uni-layouts": "^0.1.10",
|
|
34
34
|
"@uni-helper/vite-plugin-uni-pages": "^0.2.28",
|
|
35
35
|
"unocss-applet": "^0.10.0",
|
|
36
|
-
"@vixt/core": "0.5.
|
|
37
|
-
"@vixt/vue": "0.5.
|
|
36
|
+
"@vixt/core": "0.5.6",
|
|
37
|
+
"@vixt/vue": "0.5.6"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "unbuild",
|