zuby 1.0.65 → 1.0.66
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/config.js +10 -1
- package/package.json +1 -1
- package/types.d.ts +4 -2
package/config.js
CHANGED
|
@@ -114,7 +114,16 @@ export const getZubyInternalConfig = async (configFilePath, cache = true) => {
|
|
|
114
114
|
path,
|
|
115
115
|
templateType: TEMPLATES.handler,
|
|
116
116
|
}),
|
|
117
|
-
addToHead: (element) =>
|
|
117
|
+
addToHead: (element, front = false) => {
|
|
118
|
+
if (front)
|
|
119
|
+
return zubyConfig.headElements?.unshift(element);
|
|
120
|
+
zubyConfig.headElements?.push(element);
|
|
121
|
+
},
|
|
122
|
+
addToBody: (element, front = false) => {
|
|
123
|
+
if (front)
|
|
124
|
+
return zubyConfig.bodyElements?.unshift(element);
|
|
125
|
+
zubyConfig.bodyElements?.push(element);
|
|
126
|
+
},
|
|
118
127
|
injectToEntry: (scriptCode, position = 'bottom') => {
|
|
119
128
|
if (position === 'top')
|
|
120
129
|
return zubyConfig.entryScriptsTop?.push(scriptCode);
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -199,7 +199,7 @@ export interface ZubyConfig {
|
|
|
199
199
|
image?: {
|
|
200
200
|
/**
|
|
201
201
|
* The path to the image loader function.
|
|
202
|
-
* @default 'zuby/imageLoader.js'
|
|
202
|
+
* @default 'zuby/image/imageLoader.js'
|
|
203
203
|
*/
|
|
204
204
|
loader?: string;
|
|
205
205
|
/**
|
|
@@ -427,6 +427,7 @@ export interface ZubyPlugin extends VitePlugin {
|
|
|
427
427
|
}
|
|
428
428
|
export interface ZubyConfigSetupHookParams {
|
|
429
429
|
config: ZubyConfig;
|
|
430
|
+
logger: ZubyLogger;
|
|
430
431
|
command: 'dev' | 'build';
|
|
431
432
|
addEntryTemplate: (entryFile: string) => void;
|
|
432
433
|
addAppTemplate: (appFile: string, path?: string) => void;
|
|
@@ -436,7 +437,8 @@ export interface ZubyConfigSetupHookParams {
|
|
|
436
437
|
addLoaderTemplate: (loaderFile: string, path?: string) => void;
|
|
437
438
|
addPage: (pageFile: string, path?: string) => void;
|
|
438
439
|
addHandler: (handlerFile: string, path?: string) => void;
|
|
439
|
-
addToHead: (element: string) => void;
|
|
440
|
+
addToHead: (element: string, front?: boolean) => void;
|
|
441
|
+
addToBody: (element: string, front?: boolean) => void;
|
|
440
442
|
injectToEntry: (scriptCode: string, position?: 'top' | 'bottom') => void;
|
|
441
443
|
}
|
|
442
444
|
export interface ZubyConfigDoneHookParams extends ZubyConfigSetupHookParams {
|