Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tomleePHP
uni-app
提交
f2eb0cf7
U
uni-app
项目概览
tomleePHP
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f2eb0cf7
编写于
8月 21, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(app-plus-nvue): add changed files log
上级
4a8a5d3e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
58 addition
and
26 deletion
+58
-26
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
+5
-25
packages/vue-cli-plugin-hbuilderx/package.json
packages/vue-cli-plugin-hbuilderx/package.json
+1
-1
packages/vue-cli-plugin-hbuilderx/packages/webpack-app-plus-nvue-plugin/index.js
...-hbuilderx/packages/webpack-app-plus-nvue-plugin/index.js
+52
-0
未找到文件。
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
浏览文件 @
f2eb0cf7
...
...
@@ -3,10 +3,6 @@ const webpack = require('webpack')
const
VueLoaderPlugin
=
require
(
'
vue-loader/lib/plugin
'
)
const
CopyWebpackPlugin
=
require
(
'
copy-webpack-plugin
'
)
const
{
done
}
=
require
(
'
@vue/cli-shared-utils
'
)
const
{
getNVueMainEntry
,
nvueJsPreprocessOptions
,
...
...
@@ -14,6 +10,7 @@ const {
devtoolModuleFilenameTemplate
}
=
require
(
'
@dcloudio/uni-cli-shared
'
)
const
WebpackAppPlusNVuePlugin
=
require
(
'
../packages/webpack-app-plus-nvue-plugin
'
)
const
WebpackErrorsPlugin
=
require
(
'
@dcloudio/vue-cli-plugin-uni/packages/webpack-errors-plugin
'
)
const
onErrors
=
require
(
'
@dcloudio/vue-cli-plugin-uni/util/on-errors
'
)
...
...
@@ -51,12 +48,12 @@ if (
)
{
provide
[
'
__f__
'
]
=
[
require
.
resolve
(
'
@dcloudio/vue-cli-plugin-uni/lib/format-log.js
'
),
'
default
'
]
}
const
plugins
=
[
new
VueLoaderPlugin
(),
new
webpack
.
DefinePlugin
({
'
process.env
'
:
{
'
NODE_ENV
'
:
JSON
.
stringify
(
process
.
env
.
NODE_ENV
),
'
NODE_ENV
'
:
JSON
.
stringify
(
process
.
env
.
NODE_ENV
),
'
VUE_APP_PLATFORM
'
:
JSON
.
stringify
(
process
.
env
.
UNI_PLATFORM
)
}
}),
...
...
@@ -69,28 +66,11 @@ const plugins = [
new
WebpackErrorsPlugin
({
onErrors
}),
function
(
compiler
)
{
compiler
.
hooks
.
done
.
tapPromise
(
'
WebpackAppPlusNVuePlugin
'
,
compilation
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
isFirst
)
{
isFirst
=
false
}
else
{
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
done
(
`Build complete. Watching for changes...`
)
}
else
{
done
(
`Build complete. `
)
}
}
resolve
()
})
})
}
new
WebpackAppPlusNVuePlugin
()
]
const
excludeModuleReg
=
/node_modules
(?!(\/
|
\\)
.*
(
weex
)
.*
)
/
let
isFirst
=
!
process
.
env
.
UNI_USING_NATIVE
const
rules
=
[{
test
:
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
pages.json
'
),
use
:
[{
...
...
@@ -210,7 +190,7 @@ module.exports = function (entry) {
extensions
:
[
'
.js
'
,
'
.nvue
'
,
'
.vue
'
,
'
.json
'
],
alias
:
{
'
@
'
:
process
.
env
.
UNI_INPUT_DIR
,
'
uni-pages
'
:
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
pages.json
'
),
'
uni-pages
'
:
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
pages.json
'
),
'
@dcloudio/uni-stat
'
:
require
.
resolve
(
'
@dcloudio/uni-stat
'
),
'
uni-stat-config
'
:
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
pages.json
'
)
+
'
?
'
+
...
...
packages/vue-cli-plugin-hbuilderx/package.json
浏览文件 @
f2eb0cf7
{
"name"
:
"@dcloudio/vue-cli-plugin-hbuilderx"
,
"version"
:
"1.0.13
5
"
,
"version"
:
"1.0.13
6
"
,
"description"
:
"HBuilderX plugin for vue-cli 3"
,
"main"
:
"index.js"
,
"scripts"
:
{
...
...
packages/vue-cli-plugin-hbuilderx/packages/webpack-app-plus-nvue-plugin/index.js
0 → 100644
浏览文件 @
f2eb0cf7
const
{
done
}
=
require
(
'
@vue/cli-shared-utils
'
)
class
WebpackAppPlusNVuePlugin
{
apply
(
compiler
)
{
let
isFirst
=
!
process
.
env
.
UNI_USING_NATIVE
const
chunkVersions
=
{}
const
changedFiles
=
[]
compiler
.
hooks
.
emit
.
tapAsync
(
'
webpack-uni-nvue
'
,
(
compilation
,
callback
)
=>
{
changedFiles
.
length
=
0
const
changedChunks
=
compilation
.
chunks
.
filter
(
chunk
=>
{
const
oldVersion
=
chunkVersions
[
chunk
.
name
]
chunkVersions
[
chunk
.
name
]
=
chunk
.
hash
return
chunk
.
hash
!==
oldVersion
})
changedChunks
.
map
(
chunk
=>
{
if
(
Array
.
isArray
(
chunk
.
files
))
{
chunk
.
files
.
forEach
(
file
=>
{
!
changedFiles
.
includes
(
file
)
&&
(
changedFiles
.
push
(
file
))
})
}
})
callback
()
})
compiler
.
hooks
.
done
.
tapPromise
(
'
webpack-uni-nvue
'
,
compilation
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
isFirst
)
{
isFirst
=
false
}
else
{
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
if
(
changedFiles
.
length
>
0
&&
!
changedFiles
.
find
(
file
=>
file
===
'
app-config.js
'
||
file
===
'
app-service.js
'
)
)
{
done
(
`Build complete. PAGES:`
+
JSON
.
stringify
(
changedFiles
))
}
else
{
done
(
`Build complete. Watching for changes...`
)
}
}
else
{
done
(
`Build complete. `
)
}
}
resolve
()
})
})
}
}
module
.
exports
=
WebpackAppPlusNVuePlugin
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录