@tarojs/service 3.7.0-alpha.2 → 3.7.0-alpha.22

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.
@@ -1,6 +1,7 @@
1
1
  import type helper from '@tarojs/helper';
2
- import type { IProjectConfig } from '@tarojs/taro/types/compile';
3
- import type { IModifyWebpackChain } from '@tarojs/taro/types/compile/hooks';
2
+ import type runnerUtils from '@tarojs/runner-utils';
3
+ import type { IMiniFilesConfig, IProjectConfig } from '@tarojs/taro/types/compile';
4
+ import type { IModifyChainData } from '@tarojs/taro/types/compile/hooks';
4
5
  import type joi from 'joi';
5
6
  import type Webpack from 'webpack';
6
7
  import type Chain from 'webpack-chain';
@@ -27,8 +28,8 @@ export interface IPaths {
27
28
  */
28
29
  nodeModulesPath: string;
29
30
  }
30
- export declare type Func = (...args: any[]) => any;
31
- export declare type IPluginsObject = Record<string, Record<any, any> | null>;
31
+ export type Func = (...args: any[]) => any;
32
+ export type IPluginsObject = Record<string, Record<any, any> | null>;
32
33
  export interface IPlugin {
33
34
  id: string;
34
35
  path: string;
@@ -36,7 +37,7 @@ export interface IPlugin {
36
37
  type: PluginType;
37
38
  apply: Func;
38
39
  }
39
- export declare type IPreset = IPlugin;
40
+ export type IPreset = IPlugin;
40
41
  export interface IHook {
41
42
  name: string;
42
43
  plugin?: string;
@@ -81,6 +82,10 @@ export declare interface IPluginContext {
81
82
  * 为包 @tarojs/helper 的快捷使用方式,包含其所有 API
82
83
  */
83
84
  helper: typeof helper;
85
+ /**
86
+ * 为包 @tarojs/runner-utils 的快捷使用方式,包含其所有 API
87
+ */
88
+ runnerUtils: typeof runnerUtils;
84
89
  /**
85
90
  * 项目配置
86
91
  */
@@ -142,14 +147,14 @@ export declare interface IPluginContext {
142
147
  modifyWebpackChain: (fn: (args: {
143
148
  chain: Chain;
144
149
  webpack: typeof Webpack;
145
- data?: IModifyWebpackChain;
150
+ data?: IModifyChainData;
146
151
  }) => void) => void;
147
152
  /**
148
153
  * 编译中修改 vite 配置
149
154
  */
150
155
  modifyViteConfig: (fn: (args: {
151
156
  viteConfig: any;
152
- componentConfig?: IModifyWebpackChain['componentConfig'];
157
+ data?: IModifyChainData;
153
158
  }) => void) => void;
154
159
  /**
155
160
  * 修改编译后的结果
@@ -162,7 +167,13 @@ export declare interface IPluginContext {
162
167
  * 修改编译过程中的页面组件配置
163
168
  */
164
169
  modifyMiniConfigs: (fn: (args: {
165
- configMap: any;
170
+ configMap: IMiniFilesConfig;
171
+ }) => void) => void;
172
+ /**
173
+ * 修改 Taro 编译配置
174
+ */
175
+ modifyRunnerOpts: (fn: (args: {
176
+ opts: any;
166
177
  }) => void) => void;
167
178
  [key: string]: any;
168
179
  }