@tarojs/taro 3.4.8 → 3.5.0-alpha.10

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": "3.4.8",
3
+ "version": "3.5.0-alpha.10",
4
4
  "description": "Taro framework",
5
5
  "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro#readme",
6
6
  "main": "index.js",
@@ -24,9 +24,23 @@
24
24
  "author": "O2Team",
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
- "@tarojs/api": "3.4.8",
28
- "@tarojs/runtime": "3.4.8",
29
- "@tarojs/taro-h5": "3.4.8"
27
+ "@tarojs/api": "3.5.0-alpha.10",
28
+ "@tarojs/runtime": "3.5.0-alpha.10",
29
+ "@tarojs/taro-h5": "3.5.0-alpha.10"
30
30
  },
31
- "gitHead": "a025bcbb226ed3d01ed218c269a05d2e98109a46"
31
+ "peerDependenciesMeta": {
32
+ "@types/react": {
33
+ "optional": true
34
+ },
35
+ "@types/webpack": {
36
+ "optional": true
37
+ },
38
+ "@types/webpack-dev-server": {
39
+ "optional": true
40
+ },
41
+ "vue": {
42
+ "optional": true
43
+ }
44
+ },
45
+ "gitHead": "8569f73a71cd11c697e66662d584c17175c7343b"
32
46
  }
@@ -1,6 +1,6 @@
1
- import * as webpack from 'webpack'
2
- import * as webpackDevServer from 'webpack-dev-server'
3
1
  export { Current } from '@tarojs/runtime'
2
+ import webpack from 'webpack'
3
+ import webpackDevServer from 'webpack-dev-server'
4
4
 
5
5
  export const enum TEMPLATE_TYPES {
6
6
  WEAPP = '.wxml',
@@ -127,7 +127,7 @@ export interface IMiniAppConfig {
127
127
  }
128
128
 
129
129
  webpackChain?: (chain: any, webpack: any, PARSE_AST_TYPE: any) => void
130
- entry?: webpack.Entry
130
+ entry?: webpack.EntryObject
131
131
  output?: webpack.Output
132
132
  postcss?: IPostcssOption
133
133
  cssLoaderOption?: IOption
@@ -177,7 +177,7 @@ export interface IH5Config {
177
177
 
178
178
  webpackChain?: (chain: any, webpack: any) => void
179
179
 
180
- entry?: webpack.Entry
180
+ entry?: webpack.EntryObject
181
181
  output?: webpack.Output
182
182
  router?: IH5RouterConfig
183
183
  devServer?: webpackDevServer.Configuration
@@ -357,6 +357,32 @@ export interface IManifestConfig extends ITaroManifestConfig {
357
357
 
358
358
  export type PluginItem = string | [string, object]
359
359
 
360
+ interface ICache {
361
+ enable?: boolean
362
+ buildDependencies?: Record<string, any>
363
+ name?: string
364
+ }
365
+
366
+ type CompilerTypes = 'webpack4' | 'webpack5'
367
+ interface IPrebundle {
368
+ enable?: boolean
369
+ timings?: boolean
370
+ cacheDir?: string
371
+ force?: boolean
372
+ include?: string[]
373
+ exclude?: string[]
374
+ }
375
+ interface ICompiler {
376
+ type: CompilerTypes
377
+ prebundle: IPrebundle
378
+ }
379
+ type Compiler = CompilerTypes | ICompiler
380
+
381
+ interface ILogger {
382
+ quiet: boolean
383
+ stats: boolean
384
+ }
385
+
360
386
  export interface IProjectBaseConfig {
361
387
  projectName?: string
362
388
  date?: string
@@ -369,14 +395,20 @@ export interface IProjectBaseConfig {
369
395
  alias?: IOption
370
396
  defineConstants?: IOption
371
397
  copy?: ICopyOptions
398
+ jsMinimizer?: 'terser' | 'esbuild'
399
+ cssMinimizer?: 'csso' | 'esbuild' | 'parcelCss'
372
400
  csso?: TogglableOptions
373
401
  terser?: TogglableOptions
402
+ esbuild?: Record<'minify', TogglableOptions>
374
403
  uglify?: TogglableOptions
375
404
  sass?: ISassOptions
376
405
  plugins?: PluginItem[]
377
406
  presets?: PluginItem[]
378
407
  baseLevel?: number
379
408
  framework?: string
409
+ compiler?: Compiler
410
+ cache?: ICache
411
+ logger?: ILogger
380
412
  }
381
413
 
382
414
  export interface IProjectConfig extends IProjectBaseConfig {
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
- /// <reference types="vue" />
1
+ import React from 'react'
2
+ import Vue from 'vue'
3
3
 
4
4
  import Taro, { Config } from './index'
5
5
 
@@ -73,7 +73,7 @@ declare module './index' {
73
73
  onHide?(): void
74
74
  }
75
75
  interface AppInstance extends Show {
76
- mount(component: React.ComponentClass | Vue.ComponentOptions<Vue>, id: string, cb: () => void): void
76
+ mount(component: React.Component | Vue.ComponentOptions<Vue>, id: string, cb: () => void): void
77
77
  componentDidShow?(options?: Record<string, unknown>): void
78
78
  onShow?(options?: Record<string, unknown>): void
79
79
  unmount(id: string, cb: () => void): void
@@ -177,8 +177,11 @@ declare module './index' {
177
177
  interface PageInstance extends PageLifeCycle, ComponentInstance {
178
178
  /** 页面配置 */
179
179
  config?: PageConfig
180
+ /** 页面的初始数据 */
180
181
  data?: Record<string, unknown>
182
+ /** 页面路径 */
181
183
  path?: string
184
+ /** 页面的组件选项 */
182
185
  options?: Record<string, unknown>
183
186
  }
184
187
  interface TaroStatic {
@@ -1,3 +1,5 @@
1
+ import React from 'react'
2
+
1
3
  import Taro, { Component } from './index'
2
4
 
3
5
  declare module './index' {