Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
我本凡人 一念云泥
uni-app
提交
303991e8
uni-app
项目概览
我本凡人 一念云泥
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
303991e8
编写于
3月 09, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(qa): add build mode
上级
ede72266
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
16 deletion
+29
-16
packages/uni-quickapp/lib/configure-webpack.js
packages/uni-quickapp/lib/configure-webpack.js
+8
-11
packages/uni-quickapp/lib/manifest/entry-parser.js
packages/uni-quickapp/lib/manifest/entry-parser.js
+10
-0
packages/uni-quickapp/lib/manifest/index.js
packages/uni-quickapp/lib/manifest/index.js
+9
-4
packages/vue-cli-plugin-uni/index.js
packages/vue-cli-plugin-uni/index.js
+2
-1
未找到文件。
packages/uni-quickapp/lib/configure-webpack.js
浏览文件 @
303991e8
...
...
@@ -10,6 +10,8 @@ const NotifyPlugin = require('@hap-toolkit/packager/lib/plugin/notify-plugin')
const
Css2jsonPlugin
=
require
(
'
@hap-toolkit/dsl-vue/lib/plugin/css2json-plugin
'
)
const
InstVuePlugin
=
require
(
'
@hap-toolkit/dsl-vue/lib/plugin/instvue-plugin
'
)
const
parseManifest
=
require
(
'
./manifest/index
'
)
const
env
=
{
// 平台:native
NODE_PLATFORM
:
'
native
'
,
...
...
@@ -19,10 +21,9 @@ const env = {
const
dslFilename
=
(
'
vue.
'
+
(
process
.
env
.
NODE_ENV
===
'
production
'
?
'
prod
'
:
'
dev
'
)
+
'
.js
'
)
const
manifest
=
process
.
UNI_MANIFEST
.
quickapp
||
{}
const
entryPagePath
=
process
.
UNI_PAGES
.
pages
[
0
].
path
parseManifest
(
process
.
UNI_PAGES
,
process
.
UNI_MANIFEST
)
const
versionCode
=
parseInt
(
manifest
.
versionCode
||
process
.
UNI_MANIFEST
.
versionCode
)
||
1
const
manifest
=
global
.
framework
.
manifest
if
(
!
manifest
.
package
)
{
console
.
error
(
`maniest.json quickapp 节点缺少 package 配置`
)
...
...
@@ -39,11 +40,8 @@ function genPriorities(entryPagePath) {
module
.
exports
=
{
devtool
:
false
,
entry
:
{
'
app
'
:
'
/Users/fxy/Documents/demo/my-qa-project/src/App.vue?uxType=app
'
,
'
pages/index/index
'
:
'
/Users/fxy/Documents/demo/my-qa-project/src/pages/index/index.vue?uxType=page
'
,
'
pages/detail/detail
'
:
'
/Users/fxy/Documents/demo/my-qa-project/src/pages/detail/detail.vue?uxType=page
'
,
'
pages/about/about
'
:
'
/Users/fxy/Documents/demo/my-qa-project/src/pages/about/about.vue?uxType=page
'
entry
()
{
return
process
.
UNI_ENTRY
},
plugins
:
[
new
webpack
.
DefinePlugin
({
...
...
@@ -62,16 +60,15 @@ module.exports = {
new
HandlerPlugin
({}),
new
Css2jsonPlugin
(),
new
InstVuePlugin
(),
// TODO 目前 manifest,entryPagePath 是启动时读取一次
new
ZipPlugin
({
name
:
manifest
.
package
,
icon
:
manifest
.
icon
,
versionCode
,
versionCode
:
manifest
.
versionCode
,
output
:
path
.
resolve
(
process
.
env
.
UNI_OUTPUT_DIR
,
'
..
'
),
pathBuild
:
process
.
env
.
UNI_OUTPUT_DIR
,
pathSignFolder
:
'
./sign
'
,
sign
:
process
.
env
.
NODE_ENV
===
'
production
'
?
'
release
'
:
'
debug
'
,
priorities
:
genPriorities
(
entryPagePath
),
priorities
:
genPriorities
(
manifest
.
router
.
entry
),
subpackages
:
undefined
,
comment
:
''
,
cwd
:
process
.
env
.
UNI_INPUT_DIR
,
...
...
packages/uni-quickapp/lib/manifest/entry-parser.js
0 → 100644
浏览文件 @
303991e8
const
path
=
require
(
'
path
'
)
module
.
exports
=
function
parseEntry
(
pages
)
{
const
entry
=
{
'
app
'
:
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
App.vue?uxType=app
'
)
}
pages
.
forEach
(
page
=>
{
entry
[
page
.
path
]
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
page
.
path
+
'
.vue?uxType=page
'
)
})
return
entry
}
packages/uni-quickapp/lib/manifest/index.js
浏览文件 @
303991e8
...
...
@@ -2,15 +2,20 @@ const parseBase = require('./base-parser')
const
parsePages
=
require
(
'
./pages-parser
'
)
const
parseDisplay
=
require
(
'
./display-parser
'
)
const
parseEntry
=
require
(
'
./entry-parser
'
)
module
.
exports
=
function
(
pagesJson
,
manifestJson
,
loader
)
{
const
manifest
=
manifestJson
.
quickapp
||
{}
parseBase
(
manifest
,
manifestJson
)
parsePages
(
manifest
,
pagesJson
.
pages
)
parseDisplay
(
manifest
,
pagesJson
.
pages
,
pagesJson
.
globalStyle
)
global
.
framework
.
manifest
=
manifest
loader
.
emitFile
(
'
manifest.json
'
,
JSON
.
stringify
(
manifest
))
process
.
UNI_ENTRY
=
parseEntry
(
pagesJson
.
pages
)
global
.
framework
.
manifest
=
manifest
loader
&&
loader
.
emitFile
(
'
manifest.json
'
,
JSON
.
stringify
(
manifest
))
return
''
}
packages/vue-cli-plugin-uni/index.js
浏览文件 @
303991e8
...
...
@@ -22,7 +22,8 @@ module.exports = (api, options) => {
if
(
process
.
env
.
UNI_PLATFORM
===
'
quickapp
'
)
{
process
.
env
.
UNI_OUTPUT_DIR
=
path
.
resolve
(
process
.
env
.
UNI_OUTPUT_DIR
,
'
build
'
)
Object
.
assign
(
options
,
{
assetsDir
,
assetsDir
,
parallel
:
false
,
outputDir
:
process
.
env
.
UNI_OUTPUT_DIR
})
require
(
'
./lib/options
'
)(
options
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录