@tarojs/taro 4.0.0-beta.32 → 4.0.0-beta.34

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/taro",
3
- "version": "4.0.0-beta.32",
3
+ "version": "4.0.0-beta.34",
4
4
  "description": "Taro framework",
5
5
  "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro#readme",
6
6
  "main": "index.js",
@@ -21,17 +21,17 @@
21
21
  "author": "O2Team",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "@tarojs/api": "4.0.0-beta.32"
24
+ "@tarojs/api": "4.0.0-beta.34"
25
25
  },
26
26
  "devDependencies": {
27
- "@tarojs/helper": "4.0.0-beta.32",
28
- "@tarojs/shared": "4.0.0-beta.32",
29
- "@tarojs/runtime": "4.0.0-beta.32"
27
+ "@tarojs/shared": "4.0.0-beta.34",
28
+ "@tarojs/runtime": "4.0.0-beta.34",
29
+ "@tarojs/helper": "4.0.0-beta.34"
30
30
  },
31
31
  "peerDependencies": {
32
- "@tarojs/helper": "~4.0.0-beta.32",
33
- "@tarojs/shared": "~4.0.0-beta.32",
34
- "@tarojs/runtime": "~4.0.0-beta.32"
32
+ "@tarojs/helper": "~4.0.0-beta.34",
33
+ "@tarojs/shared": "~4.0.0-beta.34",
34
+ "@tarojs/runtime": "~4.0.0-beta.34"
35
35
  },
36
36
  "peerDependenciesMeta": {
37
37
  "@types/react": {
@@ -5,6 +5,7 @@ import type HtmlWebpackPlugin from 'html-webpack-plugin'
5
5
  import type { IOption, IPostcssOption, IUrlLoaderOption } from './util'
6
6
  import type { OutputOptions as RollupOutputOptions } from 'rollup'
7
7
  import type { Compiler, CompilerTypes, CompilerWebpackTypes } from '../compiler'
8
+ import type { OutputExt } from './project'
8
9
 
9
10
  export interface IH5RouterConfig {
10
11
  /** 配置路由模式 */
@@ -40,7 +41,9 @@ export interface IH5Config <T extends CompilerTypes = CompilerWebpackTypes> {
40
41
  /** webpack 编译模式下,可用于修改、拓展 Webpack 的 output 选项,配置项参考[官方文档](https://webpack.js.org/configuration/output/)
41
42
  * vite 编译模式下,用于修改、扩展 rollup 的 output,目前仅适配 chunkFileNames 和 assetFileNames 两个配置,修改其他配置请使用 vite 插件进行修改。配置想参考[官方文档](https://rollupjs.org/configuration-options/)
42
43
  */
43
- output?: T extends 'vite' ? Pick<RollupOutputOptions, 'chunkFileNames' | 'assetFileNames' > : Webpack.Configuration['output']
44
+ output?: T extends 'vite'
45
+ ? Pick<RollupOutputOptions, 'chunkFileNames' | 'assetFileNames'> & OutputExt
46
+ : Webpack.Configuration['output']
44
47
 
45
48
  /** 路由相关的配置 */
46
49
  router?: IH5RouterConfig
@@ -120,7 +123,7 @@ export interface IH5Config <T extends CompilerTypes = CompilerWebpackTypes> {
120
123
  }
121
124
  /** 生成的代码是否要兼容旧版浏览器,值为 true 时,会去读取 package.json 的 browserslist 字段。只在 vite 编译模式下有效 */
122
125
  legacy?: T extends 'vite' ? boolean : undefined
123
-
126
+
124
127
  /** 使用的编译工具。可选值:webpack4、webpack5、vite */
125
128
  compiler?: Compiler<T>
126
129
  }
@@ -1,12 +1,12 @@
1
+ import type { OutputOptions as RollupOutputOptions } from 'rollup'
2
+ import type Webpack from 'webpack'
1
3
  import type Chain from 'webpack-chain'
2
4
 
3
5
  import type { IOption, IPostcssOption, IUrlLoaderOption } from './util'
4
- import type { Compiler, CompilerTypes, CompilerWebpackTypes } from '../compiler'
6
+ import type { CompilerTypes, CompilerWebpackTypes } from '../compiler'
7
+ import type { OutputExt } from './project'
5
8
 
6
9
  export interface IHarmonyConfig<T extends CompilerTypes = CompilerWebpackTypes> {
7
- /** Harmony 编译方式 */
8
- compiler?: Compiler
9
-
10
10
  /** Harmony 项目地址 */
11
11
  projectPath: string
12
12
 
@@ -3,6 +3,7 @@ import type Chain from 'webpack-chain'
3
3
  import type { IOption, IPostcssOption, IUrlLoaderOption } from './util'
4
4
  import type { OutputOptions as RollupOutputOptions } from 'rollup'
5
5
  import type { Compiler, CompilerTypes, CompilerWebpackTypes } from '../compiler'
6
+ import type { OutputExt } from './project'
6
7
 
7
8
  interface Runtime {
8
9
  enableInnerHTML?: boolean
@@ -14,21 +15,6 @@ interface Runtime {
14
15
  enableMutationObserver?: boolean
15
16
  }
16
17
 
17
- interface OutputExt {
18
- /**
19
- * 编译前清空输出目录
20
- * @since Taro v3.6.9
21
- * @description
22
- * - 默认清空输出目录,可设置 clean: false 不清空
23
- * - 可设置 clean: { keep: ['project.config.json'] } 保留指定文件
24
- * - 注意 clean.keep 不支持函数
25
- */
26
- clean?: boolean | {
27
- /** 保留指定文件不删除 */
28
- keep?: Array<string | RegExp> | string | RegExp
29
- }
30
- }
31
-
32
18
  export interface IMiniAppConfig<T extends CompilerTypes = CompilerWebpackTypes> {
33
19
  /** 用于控制是否生成 js、css 对应的 sourceMap (默认值:watch 模式下为 true,否则为 false) */
34
20
  enableSourceMap?: boolean
@@ -318,3 +318,18 @@ export interface IProjectConfig<T extends CompilerTypes = CompilerWebpackTypes>
318
318
 
319
319
  [key: string]: any
320
320
  }
321
+
322
+ export interface OutputExt {
323
+ /**
324
+ * 编译前清空输出目录
325
+ * @since Taro v3.6.9
326
+ * @description
327
+ * - 默认清空输出目录,可设置 clean: false 不清空
328
+ * - 可设置 clean: { keep: ['project.config.json'] } 保留指定文件
329
+ * - 注意 clean.keep 不支持函数
330
+ */
331
+ clean?: boolean | {
332
+ /** 保留指定文件不删除 */
333
+ keep?: Array<string | RegExp> | string | RegExp
334
+ }
335
+ }
@@ -1,3 +1,11 @@
1
1
  export { Current } from '@tarojs/runtime'
2
2
 
3
+ export interface IFileType {
4
+ style: string
5
+ script: string
6
+ templ: string
7
+ config: string
8
+ xs?: string
9
+ }
10
+
3
11
  export * from './config'
@@ -1,9 +1,10 @@
1
1
  import type { RecursiveTemplate, UnRecursiveTemplate } from '@tarojs/shared/dist/template'
2
+ import type { AppConfig, PageConfig } from '@tarojs/taro'
2
3
  import type { PluginContext } from 'rollup'
3
- import type { AppConfig, PageConfig } from '../index'
4
4
  import type { IMiniFilesConfig, IH5Config, IHarmonyConfig, IMiniAppConfig } from './config'
5
5
  import type { IProjectConfig } from './config/project'
6
6
  import type { IComponentConfig } from './hooks'
7
+ import type { IFileType } from './index'
7
8
 
8
9
  export interface ViteNativeCompMeta {
9
10
  name: string
@@ -41,7 +42,6 @@ export interface VitePageMeta {
41
42
  cssPath?: string
42
43
  }
43
44
 
44
-
45
45
  export interface ViteH5BuildConfig extends CommonBuildConfig, IH5Config<'vite'> {
46
46
  entryFileName?: string
47
47
  runtimePath?: string | string[]