File tree Expand file tree Collapse file tree 2 files changed +31
-26
lines changed Expand file tree Collapse file tree 2 files changed +31
-26
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " mpbuild" ,
3
- "version" : " 1.4.2 " ,
3
+ "version" : " 1.4.3 " ,
4
4
"description" : " " ,
5
5
"main" : " src/index.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -10,14 +10,12 @@ const chalk = require('chalk');
10
10
11
11
module . exports = class ProjectConfigPlugin {
12
12
constructor ( options ) {
13
- this . options = Object . assign (
14
- { } ,
15
- {
16
- projectname : '' ,
17
- appId : ''
18
- } ,
19
- options
20
- ) ;
13
+ this . options = {
14
+
15
+ projectname : '' ,
16
+ appId : '' ,
17
+ ...options
18
+ } ;
21
19
}
22
20
23
21
apply ( mpb ) {
@@ -27,52 +25,59 @@ module.exports = class ProjectConfigPlugin {
27
25
const projectConfigFile = path . join ( distDir , 'project.config.json' ) ;
28
26
const isExist = fs . existsSync ( projectConfigFile ) ;
29
27
if ( ! isExist ) {
30
- console . log ( chalk . gray ( '[ProjectConfigPlugin]: ' ) , chalk . blue ( 'project.config.json 不存在,重新生成' ) ) ;
28
+ console . log (
29
+ chalk . gray ( '[ProjectConfigPlugin]: ' ) ,
30
+ chalk . blue ( 'project.config.json 不存在,重新生成' )
31
+ ) ;
31
32
await fse . outputJson ( projectConfigFile , {
32
33
description : '项目配置文件' ,
33
34
packOptions : {
34
- ignore : [ ]
35
+ ignore : [ ] ,
35
36
} ,
36
37
setting : {
37
38
urlCheck : false ,
38
- es6 : false ,
39
- postcss : true ,
40
- minified : false ,
41
- newFeature : true
39
+ es6 : false ,
40
+ postcss : true ,
41
+ minified : false ,
42
+ newFeature : true ,
43
+ ...this . options . setting
42
44
} ,
43
45
compileType : 'miniprogram' ,
44
- libVersion : '2.0.3 ' ,
46
+ libVersion : this . options . libVersion || '2.10.4 ' ,
45
47
appid : this . options . appId ,
46
48
projectname : this . options . projectname ,
47
49
scripts : {
48
50
beforeCompile : '' ,
49
51
beforePreview : '' ,
50
- beforeUpload : ''
52
+ beforeUpload : '' ,
51
53
} ,
52
54
condition : {
53
55
search : {
54
56
current : - 1 ,
55
- list : [ ]
57
+ list : [ ] ,
56
58
} ,
57
59
conversation : {
58
60
current : - 1 ,
59
- list : [ ]
61
+ list : [ ] ,
60
62
} ,
61
63
plugin : {
62
64
current : - 1 ,
63
- list : [ ]
65
+ list : [ ] ,
64
66
} ,
65
67
game : {
66
- list : [ ]
68
+ list : [ ] ,
67
69
} ,
68
70
miniprogram : {
69
71
current : 31 ,
70
- list : [ ]
71
- }
72
- }
72
+ list : [ ] ,
73
+ } ,
74
+ } ,
73
75
} ) ;
74
- } else {
75
- console . log ( chalk . gray ( '[ProjectConfigPlugin]: ' ) , chalk . blue ( 'project.config.json 存在,不需要重新生成' ) ) ;
76
+ } else {
77
+ console . log (
78
+ chalk . gray ( '[ProjectConfigPlugin]: ' ) ,
79
+ chalk . blue ( 'project.config.json 存在,不需要重新生成' )
80
+ ) ;
76
81
}
77
82
return Promise . resolve ( ) ;
78
83
} ) ;
You can’t perform that action at this time.
0 commit comments