Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
a17ec656
U
uni-app
项目概览
DCloud
/
uni-app
2 个月 前同步成功
通知
715
Star
38705
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,发现更多精彩内容 >>
提交
a17ec656
编写于
11月 08, 2019
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: nvue-native template
上级
d9d0300b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
88 addition
and
64 deletion
+88
-64
packages/uni-cli-shared/lib/index.js
packages/uni-cli-shared/lib/index.js
+31
-29
packages/uni-cli-shared/lib/util.js
packages/uni-cli-shared/lib/util.js
+5
-2
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
+52
-33
未找到文件。
packages/uni-cli-shared/lib/index.js
浏览文件 @
a17ec656
...
...
@@ -13,7 +13,7 @@ const {
}
=
require
(
'
./manifest.js
'
)
const
{
getMainEntry
,
getMainEntry
,
getNVueMainEntry
,
parseEntry
,
parsePages
,
...
...
@@ -28,36 +28,37 @@ const {
camelize
,
hyphenate
,
removeExt
,
normalizePath
,
normalizePath
,
getComponentName
,
convertStaticStyle
convertStaticStyle
,
getTemplatePath
}
=
require
(
'
./util
'
)
const
{
getFlexDirection
,
getPlatformProject
,
const
{
getFlexDirection
,
getPlatformProject
,
isSupportSubPackages
,
getPlatforms
,
getPlatforms
,
getPlatformGlobal
,
getPlatformScss
,
getPlatformScss
,
getPlatformSass
,
runByHBuilderX
,
isInHBuilderX
,
runByHBuilderX
,
isInHBuilderX
,
isInHBuilderXAlpha
,
getPlatformExts
,
getPlatformTarget
,
getPlatformVue
,
getPlatformCompiler
,
getPlatformCompiler
,
getShadowCss
,
getPlatformCssVars
,
getPlatformCssnano
,
getPlatformCssVars
,
getPlatformCssnano
,
getShadowTemplate
,
jsPreprocessOptions
,
cssPreprocessOptions
,
htmlPreprocessOptions
,
nvueJsPreprocessOptions
,
nvueJsPreprocessOptions
,
nvueCssPreprocessOptions
,
nvueHtmlPreprocessOptions
,
nvueHtmlPreprocessOptions
,
devtoolModuleFilenameTemplate
}
=
require
(
'
./platform
'
)
...
...
@@ -75,38 +76,39 @@ module.exports = {
parseEntry
,
parsePages
,
getH5Options
,
getMainEntry
,
getMainEntry
,
getNVueMainEntry
,
getPagesJson
,
getManifestJson
,
getNetworkTimeout
,
runByHBuilderX
,
isInHBuilderX
,
isInHBuilderXAlpha
,
runByHBuilderX
,
isInHBuilderX
,
isInHBuilderXAlpha
,
isSupportSubPackages
,
getPlatforms
,
getPlatforms
,
getFlexDirection
,
getPlatformScss
,
getPlatformScss
,
getPlatformSass
,
getPlatformExts
,
getPlatformTarget
,
getPlatformTarget
,
getPlatformProject
,
getPlatformVue
,
getPlatformGlobal
,
getPlatformVue
,
getPlatformGlobal
,
getShadowCss
,
getPlatformCssVars
,
getPlatformCssVars
,
getPlatformCssnano
,
getPlatformCompiler
,
getPlatformCompiler
,
getShadowTemplate
,
parsePagesJson
,
parseManifestJson
,
parseManifestJson
,
getComponentName
,
convertStaticStyle
,
getTemplatePath
,
jsPreprocessOptions
,
cssPreprocessOptions
,
htmlPreprocessOptions
,
nvueJsPreprocessOptions
,
nvueJsPreprocessOptions
,
nvueCssPreprocessOptions
,
nvueHtmlPreprocessOptions
,
nvueHtmlPreprocessOptions
,
devtoolModuleFilenameTemplate
}
packages/uni-cli-shared/lib/util.js
浏览文件 @
a17ec656
...
...
@@ -115,5 +115,8 @@ module.exports = {
return
str
.
replace
(
'
wx-
'
,
'
weixin-
'
)
}
return
str
})
}
}),
getTemplatePath
()
{
return
path
.
join
(
__dirname
,
'
../template
'
)
}
}
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
浏览文件 @
a17ec656
...
...
@@ -8,7 +8,8 @@ const {
getNVueMainEntry
,
nvueJsPreprocessOptions
,
nvueHtmlPreprocessOptions
,
devtoolModuleFilenameTemplate
devtoolModuleFilenameTemplate
,
getTemplatePath
}
=
require
(
'
@dcloudio/uni-cli-shared
'
)
const
WebpackAppPlusNVuePlugin
=
require
(
'
../packages/webpack-app-plus-nvue-plugin
'
)
...
...
@@ -95,7 +96,7 @@ const rules = [{
babelrc
:
false
}
},
jsPreprocessorLoader
jsPreprocessorLoader
],
exclude
(
modulePath
)
{
return
excludeModuleReg
.
test
(
modulePath
)
&&
modulePath
.
indexOf
(
'
@dcloudio
'
)
===
-
1
...
...
@@ -161,38 +162,56 @@ rules.unshift({
if
(
process
.
env
.
UNI_USING_NATIVE
)
{
plugins
.
push
(
new
WebpackUniMPPlugin
())
let
nativeTemplatePath
=
path
.
resolve
(
process
.
env
.
UNI_HBUILDERX_PLUGINS
,
'
weapp-tools/template/v8-native
'
)
if
(
!
fs
.
existsSync
(
nativeTemplatePath
))
{
// 兼容旧版本
nativeTemplatePath
=
path
.
resolve
(
process
.
env
.
UNI_HBUILDERX_PLUGINS
,
'
weapp-tools/template/v8
'
)
}
plugins
.
push
(
new
CopyWebpackPlugin
([{
const
array
=
[{
from
:
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
static
'
),
to
:
'
static
'
},
{
from
:
nativeTemplatePath
,
to
:
process
.
env
.
UNI_OUTPUT_DIR
},
{
from
:
path
.
resolve
(
process
.
env
.
UNI_HBUILDERX_PLUGINS
,
'
weapp-tools/template/common
'
),
to
:
process
.
env
.
UNI_OUTPUT_DIR
,
ignore
:
[
'
*.js
'
,
'
*.json
'
,
'
__uniapppicker.html
'
,
'
__uniappview.html
'
]
}]))
}]
if
(
process
.
env
.
UNI_USING_NVUE_COMPILER
)
{
array
.
push
({
from
:
path
.
resolve
(
getTemplatePath
(),
'
common
'
),
to
:
process
.
env
.
UNI_OUTPUT_DIR
},
{
from
:
path
.
resolve
(
process
.
env
.
UNI_HBUILDERX_PLUGINS
,
'
weapp-tools/template/common
'
),
to
:
process
.
env
.
UNI_OUTPUT_DIR
,
ignore
:
[
'
*.js
'
,
'
*.json
'
,
'
__uniapppicker.html
'
,
'
__uniappview.html
'
,
'
__uniappmarker@3x.png
'
,
'
__uniappopenlocation.html
'
,
'
__uniapppicker.html
'
]
})
}
else
{
let
nativeTemplatePath
=
path
.
resolve
(
process
.
env
.
UNI_HBUILDERX_PLUGINS
,
'
weapp-tools/template/v8-native
'
)
if
(
!
fs
.
existsSync
(
nativeTemplatePath
))
{
// 兼容旧版本
nativeTemplatePath
=
path
.
resolve
(
process
.
env
.
UNI_HBUILDERX_PLUGINS
,
'
weapp-tools/template/v8
'
)
}
array
.
push
({
from
:
nativeTemplatePath
,
to
:
process
.
env
.
UNI_OUTPUT_DIR
},
{
from
:
path
.
resolve
(
process
.
env
.
UNI_HBUILDERX_PLUGINS
,
'
weapp-tools/template/common
'
),
to
:
process
.
env
.
UNI_OUTPUT_DIR
,
ignore
:
[
'
*.js
'
,
'
*.json
'
,
'
__uniapppicker.html
'
,
'
__uniappview.html
'
]
})
}
plugins
.
push
(
new
CopyWebpackPlugin
(
array
))
}
module
.
exports
=
function
()
{
...
...
@@ -296,4 +315,4 @@ module.exports = function () {
zlib
:
false
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录