File tree 3 files changed +42
-2
lines changed
3 files changed +42
-2
lines changed Original file line number Diff line number Diff line change 8
8
9
9
bug 或者交流建议等请反馈到 [ mpvue/issues] ( https://github.com/Meituan-Dianping/mpvue/issues ) 。
10
10
11
+ ## example
12
+ ```
13
+ const mpvueSimple = require('mpvue-simple')
14
+
15
+ // build for signel Page
16
+ mpvueSimple.build()
17
+
18
+ // or more options
19
+ mpvueSimple.build({
20
+ output: 'mp-pages',
21
+ pageName: 'login'
22
+ })
23
+
24
+ // or more options
25
+ mpvueSimple.build({
26
+ output: {
27
+ path: 'mp-pages',
28
+ jsonpFunction: 'webpackJsonpMpvue' // optional config
29
+ },
30
+ pageName: 'login'
31
+ })
32
+
33
+ // maybe you want to do something after building
34
+ mpvueSimple.build() // => Promise
35
+ .then(() => console.log('mpvue build success'))
36
+ .catch(err => throw new Error(err))
37
+ ```
38
+
39
+ ## changelog
40
+
41
+ #### ` 1.0.17 `
42
+ - 加入可选配置项 ` output.jsonpFunction ` ,mpvue 打包构建后会在 ` manifest.js ` 中生生成全局的模块加载器函数 ` global.webpackJsonp ` ,为防止和其它构建工具引起命名冲突,该默认函数名可在 output 配置中指定,示例如上。
43
+
Original file line number Diff line number Diff line change @@ -132,7 +132,14 @@ function mergeArgvConfig (config) {
132
132
133
133
// 输出文件夹
134
134
if ( argvOutput ) {
135
- const assetsRoot = path . resolve ( argvOutput )
135
+ let outputPath = argvOutput ;
136
+ if ( typeof argvOutput === 'object' ) {
137
+ outputPath = argvOutput . path ;
138
+ config . argvConfig . output = Object . assign ( { } , argvOutput ) ;
139
+ delete config . argvConfig . output . path ;
140
+ }
141
+
142
+ const assetsRoot = path . resolve ( outputPath )
136
143
defConfig . assetsRoot = assetsRoot
137
144
}
138
145
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " mpvue-simple" ,
3
- "version" : " 1.0.15 " ,
3
+ "version" : " 1.0.17 " ,
4
4
"description" : " 辅助 mpvue 快速开发 Page / Component 级小程序页面的工具" ,
5
5
"main" : " index.js" ,
6
6
"bin" : " bin/mpvue-simple" ,
You can’t perform that action at this time.
0 commit comments