Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
b381a51d
U
uni-app
项目概览
DCloud
/
uni-app
28 天 前同步成功
通知
702
Star
38704
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b381a51d
编写于
8月 05, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: support copy-webpack-plugin version 6+
上级
eb824626
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
97 addition
and
66 deletion
+97
-66
lib/h5/uni.config.js
lib/h5/uni.config.js
+2
-1
packages/uni-app-plus/lib/uni.config.js
packages/uni-app-plus/lib/uni.config.js
+9
-4
packages/uni-mp-qq/lib/uni.config.js
packages/uni-mp-qq/lib/uni.config.js
+17
-8
packages/uni-mp-weixin/lib/uni.config.js
packages/uni-mp-weixin/lib/uni.config.js
+17
-9
packages/uni-quickapp-native/lib/configure-webpack.js
packages/uni-quickapp-native/lib/configure-webpack.js
+8
-5
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
+21
-17
packages/vue-cli-plugin-hbuilderx/packages/webpack-app-plus-nvue-plugin/index.js
...-hbuilderx/packages/webpack-app-plus-nvue-plugin/index.js
+2
-5
packages/vue-cli-plugin-hbuilderx/packages/webpack-app-plus-plugin/index.js
...lugin-hbuilderx/packages/webpack-app-plus-plugin/index.js
+2
-5
packages/vue-cli-plugin-uni/lib/configure-webpack.js
packages/vue-cli-plugin-uni/lib/configure-webpack.js
+7
-4
packages/vue-cli-plugin-uni/lib/copy-webpack-options.js
packages/vue-cli-plugin-uni/lib/copy-webpack-options.js
+11
-7
packages/vue-cli-plugin-uni/package.json
packages/vue-cli-plugin-uni/package.json
+1
-1
未找到文件。
lib/h5/uni.config.js
浏览文件 @
b381a51d
...
...
@@ -19,12 +19,13 @@ function transform(content) {
}
function
getIndexCssPath
(
assetsDir
,
template
)
{
const
CopyWebpackPluginVersion
=
Number
(
require
(
'
copy-webpack-plugin/package.json
'
).
version
.
split
(
'
.
'
)[
0
])
const
VUE_APP_INDEX_CSS_HASH
=
process
.
env
.
VUE_APP_INDEX_CSS_HASH
if
(
VUE_APP_INDEX_CSS_HASH
)
{
try
{
const
templateContent
=
fs
.
readFileSync
(
getTemplatePath
(
template
))
if
(
/
\b
VUE_APP_INDEX_CSS_HASH
\b
/
.
test
(
templateContent
))
{
return
path
.
join
(
assetsDir
,
`[name].
${
VUE_APP_INDEX_CSS_HASH
}
.
[ext]`
)
return
path
.
join
(
assetsDir
,
`[name].
${
VUE_APP_INDEX_CSS_HASH
}
${
CopyWebpackPluginVersion
>
5
?
''
:
'
.
'
}
[ext]`
)
}
}
catch
(
e
)
{}
}
...
...
packages/uni-app-plus/lib/uni.config.js
浏览文件 @
b381a51d
...
...
@@ -6,12 +6,17 @@ const COMPONENTS_DIR_NAME = 'wxcomponents'
function
getComponentsCopyOption
()
{
if
(
process
.
env
.
UNI_OUTPUT_TMP_DIR
)
{
// TODO v3不需要,即将废弃
const
componentsDir
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
COMPONENTS_DIR_NAME
)
const
CopyWebpackPluginVersion
=
Number
(
require
(
'
copy-webpack-plugin/package.json
'
).
version
.
split
(
'
.
'
)[
0
])
if
(
fs
.
existsSync
(
componentsDir
))
{
return
{
const
ignore
=
[
'
**/*.vue
'
,
'
**/*.css
'
]
return
Object
.
assign
({
from
:
componentsDir
,
to
:
COMPONENTS_DIR_NAME
,
ignore
:
[
'
**/*.vue
'
,
'
**/*.css
'
]
}
to
:
COMPONENTS_DIR_NAME
},
CopyWebpackPluginVersion
>
5
?
{
globOptions
:
{
ignore
}
}
:
{
ignore
})
}
}
}
...
...
packages/uni-mp-qq/lib/uni.config.js
浏览文件 @
b381a51d
...
...
@@ -22,6 +22,7 @@ module.exports = {
subPackages
:
true
},
copyWebpackOptions
(
platformOptions
,
vueOptions
)
{
const
CopyWebpackPluginVersion
=
Number
(
require
(
'
copy-webpack-plugin/package.json
'
).
version
.
split
(
'
.
'
)[
0
])
const
copyOptions
=
[
// 'sitemap.json',
// 'ext.json',
...
...
@@ -31,21 +32,29 @@ module.exports = {
workers
&&
copyOptions
.
push
(
workers
)
const
wxcomponentsDir
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
COMPONENTS_DIR_NAME
)
const
ignore
=
[
'
**/*.vue
'
,
'
**/*.css
'
]
// v3 会自动转换生成vue,css文件,需要过滤
if
(
fs
.
existsSync
(
wxcomponentsDir
))
{
copyOptions
.
push
({
copyOptions
.
push
(
Object
.
assign
(
{
from
:
wxcomponentsDir
,
to
:
COMPONENTS_DIR_NAME
,
ignore
:
[
'
**/*.vue
'
,
'
**/*.css
'
]
// v3 会自动转换生成vue,css文件,需要过滤
})
to
:
COMPONENTS_DIR_NAME
},
CopyWebpackPluginVersion
>
5
?
{
globOptions
:
{
ignore
}
}
:
{
ignore
}))
}
global
.
uniModules
.
forEach
(
module
=>
{
const
wxcomponentsDir
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
uni_modules
'
,
module
,
COMPONENTS_DIR_NAME
)
if
(
fs
.
existsSync
(
wxcomponentsDir
))
{
copyOptions
.
push
({
copyOptions
.
push
(
Object
.
assign
(
{
from
:
wxcomponentsDir
,
to
:
'
uni_modules/
'
+
module
+
'
/
'
+
COMPONENTS_DIR_NAME
,
ignore
:
[
'
**/*.vue
'
,
'
**/*.css
'
]
// v3 会自动转换生成vue,css文件,需要过滤
})
to
:
'
uni_modules/
'
+
module
+
'
/
'
+
COMPONENTS_DIR_NAME
},
CopyWebpackPluginVersion
>
5
?
{
globOptions
:
{
ignore
}
}
:
{
ignore
}))
}
})
return
copyOptions
...
...
packages/uni-mp-weixin/lib/uni.config.js
浏览文件 @
b381a51d
...
...
@@ -24,12 +24,13 @@ module.exports = {
darkmode
:
true
},
copyWebpackOptions
(
platformOptions
,
vueOptions
)
{
const
CopyWebpackPluginVersion
=
Number
(
require
(
'
copy-webpack-plugin/package.json
'
).
version
.
split
(
'
.
'
)[
0
])
const
copyOptions
=
[
'
theme.json
'
,
'
sitemap.json
'
,
'
ext.json
'
,
'
custom-tab-bar
'
,
'
functional-pages
'
,
'
functional-pages
'
,
'
project.private.config.json
'
]
...
...
@@ -46,25 +47,32 @@ module.exports = {
const
manifestConfig
=
process
.
UNI_MANIFEST
const
weixinConfig
=
manifestConfig
[
'
mp-weixin
'
]
||
{}
const
copyWxComponentsOnDemandSwitch
=
!!
weixinConfig
.
copyWxComponentsOnDemand
// 默认值false
const
ignore
=
[
'
**/*.vue
'
,
'
**/*.css
'
]
// v3 会自动转换生成vue,css文件,需要过滤
if
(
!
copyWxComponentsOnDemandSwitch
)
{
const
wxcomponentsDir
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
COMPONENTS_DIR_NAME
)
if
(
fs
.
existsSync
(
wxcomponentsDir
))
{
copyOptions
.
push
({
copyOptions
.
push
(
Object
.
assign
(
{
from
:
wxcomponentsDir
,
to
:
COMPONENTS_DIR_NAME
,
ignore
:
[
'
**/*.vue
'
,
'
**/*.css
'
]
// v3 会自动转换生成vue,css文件,需要过滤
})
to
:
COMPONENTS_DIR_NAME
},
CopyWebpackPluginVersion
>
5
?
{
globOptions
:
{
ignore
}
}
:
{
ignore
}))
}
}
global
.
uniModules
.
forEach
(
module
=>
{
const
wxcomponentsDir
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
uni_modules
'
,
module
,
COMPONENTS_DIR_NAME
)
if
(
fs
.
existsSync
(
wxcomponentsDir
))
{
copyOptions
.
push
({
copyOptions
.
push
(
Object
.
assign
(
{
from
:
wxcomponentsDir
,
to
:
'
uni_modules/
'
+
module
+
'
/
'
+
COMPONENTS_DIR_NAME
,
ignore
:
[
'
**/*.vue
'
,
'
**/*.css
'
]
// v3 会自动转换生成vue,css文件,需要过滤
})
to
:
'
uni_modules/
'
+
module
+
'
/
'
+
COMPONENTS_DIR_NAME
},
CopyWebpackPluginVersion
>
5
?
{
globOptions
:
{
ignore
}
}
:
{
ignore
}))
}
})
return
copyOptions
...
...
packages/uni-quickapp-native/lib/configure-webpack.js
浏览文件 @
b381a51d
...
...
@@ -2,6 +2,7 @@ const path = require('path')
const
webpack
=
require
(
'
webpack
'
)
const
CopyPlugin
=
require
(
'
copy-webpack-plugin
'
)
const
CopyPluginVersion
=
Number
(
require
(
'
copy-webpack-plugin/package.json
'
).
version
.
split
(
'
.
'
)[
0
])
const
HandlerPlugin
=
require
(
'
@hap-toolkit/packager/lib/plugin/handler-plugin
'
)
const
ZipPlugin
=
require
(
'
@hap-toolkit/packager/lib/plugin/zip-plugin
'
)
...
...
@@ -39,6 +40,11 @@ function genPriorities (entryPagePath) {
const
uniCloudPath
=
require
.
resolve
(
'
@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
'
)
const
patterns
=
[{
from
:
path
.
resolve
(
__dirname
,
'
../dist/
'
+
dslFilename
),
to
:
'
dsl.js
'
}]
module
.
exports
=
{
devtool
:
false
,
entry
()
{
...
...
@@ -77,10 +83,7 @@ module.exports = {
new
webpack
.
ProvidePlugin
({
uniCloud
:
[
uniCloudPath
,
'
default
'
]
}),
new
CopyPlugin
([{
from
:
path
.
resolve
(
__dirname
,
'
../dist/
'
+
dslFilename
),
to
:
'
dsl.js
'
}]),
new
CopyPlugin
(
CopyPluginVersion
>
5
?
{
patterns
}
:
patterns
),
new
HandlerPlugin
({}),
new
Css2jsonPlugin
(),
new
InstVuePlugin
(),
...
...
@@ -101,4 +104,4 @@ module.exports = {
}),
new
NotifyPlugin
()
]
}
}
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
浏览文件 @
b381a51d
...
...
@@ -3,6 +3,7 @@ const path = require('path')
const
webpack
=
require
(
'
webpack
'
)
const
VueLoaderPlugin
=
require
(
'
@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/plugin
'
)
const
CopyWebpackPlugin
=
require
(
'
copy-webpack-plugin
'
)
const
CopyWebpackPluginVersion
=
Number
(
require
(
'
copy-webpack-plugin/package.json
'
).
version
.
split
(
'
.
'
)[
0
])
const
TerserPlugin
=
require
(
'
terser-webpack-plugin
'
)
const
{
...
...
@@ -194,7 +195,7 @@ rules.unshift({
if
(
process
.
env
.
UNI_USING_V3_NATIVE
)
{
try
{
const
automatorJson
=
require
.
resolve
(
'
@dcloudio/uni-automator/dist/automator.json
'
)
plugins
.
push
(
new
CopyWebpackPlugin
(
[{
const
patterns
=
[{
from
:
automatorJson
,
to
:
'
../.automator/
'
+
(
process
.
env
.
UNI_SUB_PLATFORM
||
process
.
env
.
UNI_PLATFORM
)
+
'
/.automator.json
'
,
...
...
@@ -207,7 +208,8 @@ if (process.env.UNI_USING_V3_NATIVE) {
}
return
''
}
}]))
}]
plugins
.
push
(
new
CopyWebpackPlugin
(
CopyWebpackPluginVersion
>
5
?
{
patterns
}
:
patterns
))
}
catch
(
e
)
{
}
}
...
...
@@ -215,7 +217,7 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
plugins
.
push
(
new
WebpackUniMPPlugin
())
const
assetsDir
=
'
static
'
const
hybridDir
=
'
hybrid/html
'
const
array
=
[{
const
patterns
=
[{
from
:
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
assetsDir
),
to
:
assetsDir
}]
...
...
@@ -223,7 +225,7 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
if
(
!
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
)
{
const
androidPrivacyPath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
androidPrivacy.json
'
)
if
(
fs
.
existsSync
(
androidPrivacyPath
))
{
array
.
push
({
patterns
.
push
({
from
:
androidPrivacyPath
,
to
:
'
androidPrivacy.json
'
})
...
...
@@ -231,7 +233,7 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
}
const
hybridHtmlPath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
hybridDir
)
if
(
fs
.
existsSync
(
hybridHtmlPath
))
{
array
.
push
({
patterns
.
push
({
from
:
hybridHtmlPath
,
to
:
hybridDir
})
...
...
@@ -242,7 +244,7 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
const
assets
=
modules
+
module
+
'
/
'
+
assetsDir
const
assetsPath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
assets
)
if
(
fs
.
existsSync
(
assetsPath
))
{
array
.
push
({
patterns
.
push
({
from
:
assetsPath
,
to
:
assets
})
...
...
@@ -250,7 +252,7 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
const
hybridHtml
=
modules
+
module
+
'
/
'
+
hybridDir
const
hybridHtmlPath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
hybridHtml
)
if
(
fs
.
existsSync
(
hybridHtmlPath
))
{
array
.
push
({
patterns
.
push
({
from
:
hybridHtmlPath
,
to
:
hybridHtml
})
...
...
@@ -258,12 +260,12 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
})
if
(
process
.
env
.
UNI_USING_NVUE_COMPILER
)
{
array
.
push
({
patterns
.
push
({
from
:
path
.
resolve
(
getTemplatePath
(),
'
common
'
),
to
:
process
.
env
.
UNI_OUTPUT_DIR
})
}
else
if
(
process
.
env
.
UNI_USING_V3_NATIVE
)
{
array
.
push
({
patterns
.
push
({
from
:
path
.
resolve
(
getTemplatePath
(),
'
weex
'
),
to
:
process
.
env
.
UNI_OUTPUT_DIR
})
...
...
@@ -275,7 +277,7 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
'
weapp-tools/template/v8
'
)
}
array
.
push
({
patterns
.
push
({
from
:
nativeTemplatePath
,
to
:
process
.
env
.
UNI_OUTPUT_DIR
},
{
...
...
@@ -284,15 +286,17 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
'
weapp-tools/template/common
'
),
to
:
process
.
env
.
UNI_OUTPUT_DIR
,
ignore
:
[
'
*.js
'
,
'
*.json
'
,
'
__uniapppicker.html
'
,
'
__uniappview.html
'
]
globOptions
:
{
ignore
:
[
'
*.js
'
,
'
*.json
'
,
'
__uniapppicker.html
'
,
'
__uniappview.html
'
]
}
})
}
plugins
.
push
(
new
CopyWebpackPlugin
(
array
))
plugins
.
push
(
new
CopyWebpackPlugin
(
CopyWebpackPluginVersion
>
5
?
{
patterns
}
:
patterns
))
}
try
{
...
...
packages/vue-cli-plugin-hbuilderx/packages/webpack-app-plus-nvue-plugin/index.js
浏览文件 @
b381a51d
...
...
@@ -14,13 +14,10 @@ class WebpackAppPlusNVuePlugin {
const
changedFiles
=
[]
compiler
.
hooks
.
emit
.
tapAsync
(
'
webpack-uni-nvue
'
,
(
compilation
,
callback
)
=>
{
changedFiles
.
length
=
0
co
nst
changedChunks
=
compilation
.
chunks
.
filter
(
chunk
=>
{
co
mpilation
.
chunks
.
forEach
(
chunk
=>
{
const
oldVersion
=
chunkVersions
[
chunk
.
name
]
chunkVersions
[
chunk
.
name
]
=
chunk
.
hash
return
chunk
.
hash
!==
oldVersion
})
changedChunks
.
map
(
chunk
=>
{
if
(
Array
.
isArray
(
chunk
.
files
))
{
if
(
chunk
.
hash
!==
oldVersion
&&
Array
.
isArray
(
chunk
.
files
))
{
chunk
.
files
.
forEach
(
file
=>
{
!
changedFiles
.
includes
(
file
)
&&
(
changedFiles
.
push
(
file
))
})
...
...
packages/vue-cli-plugin-hbuilderx/packages/webpack-app-plus-plugin/index.js
浏览文件 @
b381a51d
...
...
@@ -44,13 +44,10 @@ class WebpackAppPlusPlugin {
})
compiler
.
hooks
.
emit
.
tapAsync
(
'
WebpackAppPlusPlugin
'
,
(
compilation
,
callback
)
=>
{
co
nst
changedChunks
=
compilation
.
chunks
.
filter
(
chunk
=>
{
co
mpilation
.
chunks
.
forEach
(
chunk
=>
{
const
oldVersion
=
chunkVersions
[
chunk
.
name
]
chunkVersions
[
chunk
.
name
]
=
chunk
.
hash
return
chunk
.
hash
!==
oldVersion
})
changedChunks
.
map
(
chunk
=>
{
if
(
Array
.
isArray
(
chunk
.
files
))
{
if
(
chunk
.
hash
!==
oldVersion
&&
Array
.
isArray
(
chunk
.
files
))
{
chunk
.
files
.
forEach
(
file
=>
{
if
(
isAppService
)
{
!
serviceChangedFiles
.
includes
(
file
)
&&
(
serviceChangedFiles
.
push
(
file
))
...
...
packages/vue-cli-plugin-uni/lib/configure-webpack.js
浏览文件 @
b381a51d
...
...
@@ -2,6 +2,7 @@ const fs = require('fs')
const
path
=
require
(
'
path
'
)
const
webpack
=
require
(
'
webpack
'
)
const
CopyWebpackPlugin
=
require
(
'
copy-webpack-plugin
'
)
const
CopyWebpackPluginVersion
=
Number
(
require
(
'
copy-webpack-plugin/package.json
'
).
version
.
split
(
'
.
'
)[
0
])
const
merge
=
require
(
'
webpack-merge
'
)
...
...
@@ -231,12 +232,13 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
vueOptions
.
pluginOptions
[
'
uni-app-plus
'
].
view
if
(
!
isAppView
)
{
// app-plus view不需要copy
plugins
.
push
(
new
CopyWebpackPlugin
(
getCopyWebpackPluginOptions
(
manifestPlatformOptions
,
vueOptions
)))
const
patterns
=
getCopyWebpackPluginOptions
(
manifestPlatformOptions
,
vueOptions
)
plugins
.
push
(
new
CopyWebpackPlugin
(
CopyWebpackPluginVersion
>
5
?
{
patterns
}
:
patterns
))
}
if
(
!
process
.
env
.
UNI_SUBPACKGE
||
!
process
.
env
.
UNI_MP_PLUGIN
)
{
try
{
const
automatorJson
=
require
.
resolve
(
'
@dcloudio/uni-automator/dist/automator.json
'
)
plugins
.
push
(
new
CopyWebpackPlugin
(
[{
const
patterns
=
[{
from
:
automatorJson
,
to
:
'
../.automator/
'
+
(
process
.
env
.
UNI_SUB_PLATFORM
||
process
.
env
.
UNI_PLATFORM
)
+
'
/.automator.json
'
,
...
...
@@ -249,8 +251,9 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
}
return
''
}
}]))
}
catch
(
e
)
{}
}]
plugins
.
push
(
new
CopyWebpackPlugin
(
CopyWebpackPluginVersion
>
5
?
{
patterns
}
:
patterns
))
}
catch
(
e
)
{
}
}
if
(
process
.
UNI_SCRIPT_ENV
&&
Object
.
keys
(
process
.
UNI_SCRIPT_ENV
).
length
)
{
...
...
packages/vue-cli-plugin-uni/lib/copy-webpack-options.js
浏览文件 @
b381a51d
...
...
@@ -7,6 +7,7 @@ const {
initI18nOptions
}
=
require
(
'
@dcloudio/uni-cli-shared/lib/i18n
'
)
const
assetsDir
=
'
static
'
const
CopyWebpackPluginVersion
=
Number
(
require
(
'
copy-webpack-plugin/package.json
'
).
version
.
split
(
'
.
'
)[
0
])
function
getAssetsCopyOption
(
from
,
options
=
{})
{
if
(
path
.
isAbsolute
(
from
))
{
...
...
@@ -42,7 +43,9 @@ function getAssetsCopyOptions (assetsDir) {
const
copyOptions
=
[]
// 主包静态资源
const
mainAssetsCopyOption
=
getAssetsCopyOption
(
assetsDir
,
{
const
mainAssetsCopyOption
=
getAssetsCopyOption
(
assetsDir
,
CopyWebpackPluginVersion
>
5
?
{
globOptions
:
{
ignore
}
}
:
{
ignore
})
if
(
mainAssetsCopyOption
)
{
...
...
@@ -51,11 +54,11 @@ function getAssetsCopyOptions (assetsDir) {
// 分包静态资源
process
.
UNI_SUBPACKAGES
&&
Object
.
keys
(
process
.
UNI_SUBPACKAGES
).
forEach
(
root
=>
{
const
subAssetsCopyOption
=
getAssetsCopyOption
(
path
.
join
(
root
,
assetsDir
),
{
ignore
}
)
const
subAssetsCopyOption
=
getAssetsCopyOption
(
path
.
join
(
root
,
assetsDir
),
CopyWebpackPluginVersion
>
5
?
{
globOptions
:
{
ignore
}
}
:
{
ignore
}
)
if
(
subAssetsCopyOption
)
{
copyOptions
.
push
(
subAssetsCopyOption
)
}
...
...
@@ -91,7 +94,8 @@ function getCopyWebpackPluginOptions (platformOptions, vueOptions) {
if
(
process
.
env
.
UNI_PLATFORM
===
'
app-plus
'
&&
!
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
)
{
copyOptions
.
push
({
from
:
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
android*.json
'
),
to
:
'
[name].[ext]
'
,
to
:
`[name]
${
CopyWebpackPluginVersion
>
5
?
''
:
'
.
'
}
[ext]`
,
noErrorOnMissing
:
true
,
globOptions
:
{
ignored
:
require
(
'
./util
'
).
getWatchOptions
().
ignored
},
...
...
packages/vue-cli-plugin-uni/package.json
浏览文件 @
b381a51d
...
...
@@ -20,7 +20,6 @@
"@dcloudio/uni-stat"
:
"^2.0.0-32920211029001"
,
"buffer-json"
:
"^2.0.0"
,
"clone-deep"
:
"^4.0.1"
,
"copy-webpack-plugin"
:
"^5.1.1"
,
"cross-env"
:
"^5.2.0"
,
"envinfo"
:
"^6.0.1"
,
"hash-sum"
:
"^1.0.2"
,
...
...
@@ -39,6 +38,7 @@
"xregexp"
:
"4.0.0"
},
"peerDependencies"
:
{
"copy-webpack-plugin"
:
">=5"
,
"postcss"
:
">=7"
},
"gitHead"
:
"9e2d0f8e244724fcd64880316c57d837d1778cf8"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录