Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
anyefeiyu
uni-app
提交
05625834
U
uni-app
项目概览
anyefeiyu
/
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,发现更多精彩内容 >>
提交
05625834
编写于
4月 01, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(cli): devtool
上级
c924b047
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
56 addition
and
35 deletion
+56
-35
lib/h5/uni.config.js
lib/h5/uni.config.js
+5
-0
packages/uni-app-plus/lib/uni.config.js
packages/uni-app-plus/lib/uni.config.js
+15
-0
packages/uni-mp-alipay/lib/uni.config.js
packages/uni-mp-alipay/lib/uni.config.js
+5
-0
packages/uni-mp-baidu/lib/uni.config.js
packages/uni-mp-baidu/lib/uni.config.js
+10
-5
packages/uni-mp-qq/lib/uni.config.js
packages/uni-mp-qq/lib/uni.config.js
+5
-0
packages/uni-mp-toutiao/lib/uni.config.js
packages/uni-mp-toutiao/lib/uni.config.js
+5
-0
packages/uni-mp-weixin/lib/uni.config.js
packages/uni-mp-weixin/lib/uni.config.js
+5
-0
packages/vue-cli-plugin-uni/index.js
packages/vue-cli-plugin-uni/index.js
+6
-2
packages/vue-cli-plugin-uni/lib/app-plus/index.js
packages/vue-cli-plugin-uni/lib/app-plus/index.js
+0
-7
packages/vue-cli-plugin-uni/lib/copy-webpack-options.js
packages/vue-cli-plugin-uni/lib/copy-webpack-options.js
+0
-1
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+0
-1
packages/vue-cli-plugin-uni/lib/h5/index.js
packages/vue-cli-plugin-uni/lib/h5/index.js
+0
-1
packages/vue-cli-plugin-uni/lib/mp/index.js
packages/vue-cli-plugin-uni/lib/mp/index.js
+0
-18
未找到文件。
lib/h5/uni.config.js
浏览文件 @
05625834
...
@@ -45,5 +45,10 @@ module.exports = {
...
@@ -45,5 +45,10 @@ module.exports = {
},
},
'
hybrid/html
'
'
hybrid/html
'
]
]
},
configureWebpack
()
{
return
{
devtool
:
process
.
env
.
NODE_ENV
===
'
production
'
?
false
:
'
cheap-module-eval-source-map
'
}
}
}
}
}
packages/uni-app-plus/lib/uni.config.js
浏览文件 @
05625834
...
@@ -40,5 +40,20 @@ module.exports = {
...
@@ -40,5 +40,20 @@ module.exports = {
copyOptions
.
push
(
path
.
resolve
(
__dirname
,
'
../template/v3
'
))
copyOptions
.
push
(
path
.
resolve
(
__dirname
,
'
../template/v3
'
))
}
}
return
copyOptions
return
copyOptions
},
configureWebpack
(
webpackConfig
,
vueOptions
)
{
let
devtool
=
false
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
if
(
process
.
env
.
UNI_USING_V3
)
{
if
(
vueOptions
.
pluginOptions
[
'
uni-app-plus
'
][
'
service
'
])
{
devtool
=
'
eval-source-map
'
}
}
else
{
devtool
=
'
eval-source-map
'
}
}
return
{
devtool
}
}
}
}
}
packages/uni-mp-alipay/lib/uni.config.js
浏览文件 @
05625834
...
@@ -16,5 +16,10 @@ module.exports = {
...
@@ -16,5 +16,10 @@ module.exports = {
},
},
copyWebpackOptions
(
platformOptions
,
vueOptions
)
{
copyWebpackOptions
(
platformOptions
,
vueOptions
)
{
return
[
'
mycomponents
'
]
return
[
'
mycomponents
'
]
},
configureWebpack
()
{
return
{
devtool
:
process
.
env
.
NODE_ENV
===
'
production
'
?
false
:
'
source-map
'
}
}
}
}
}
packages/uni-mp-baidu/lib/uni.config.js
浏览文件 @
05625834
...
@@ -5,16 +5,21 @@ module.exports = {
...
@@ -5,16 +5,21 @@ module.exports = {
'
--window-top
'
:
'
0px
'
,
'
--window-top
'
:
'
0px
'
,
'
--window-bottom
'
:
'
0px
'
'
--window-bottom
'
:
'
0px
'
},
},
extnames
:
{
extnames
:
{
style
:
'
.css
'
,
style
:
'
.css
'
,
template
:
'
.swan
'
,
template
:
'
.swan
'
,
filter
:
'
.filter.js
'
filter
:
'
.filter.js
'
},
},
filterTag
:
'
filter
'
,
filterTag
:
'
filter
'
,
project
:
'
project.swan.json
'
,
project
:
'
project.swan.json
'
,
subPackages
:
true
subPackages
:
true
},
},
copyWebpackOptions
(
platformOptions
,
vueOptions
)
{
copyWebpackOptions
(
platformOptions
,
vueOptions
)
{
return
[
'
swancomponents
'
]
return
[
'
swancomponents
'
]
},
configureWebpack
()
{
return
{
devtool
:
process
.
env
.
NODE_ENV
===
'
production
'
?
false
:
'
inline-source-map
'
}
}
}
}
}
packages/uni-mp-qq/lib/uni.config.js
浏览文件 @
05625834
...
@@ -37,5 +37,10 @@ module.exports = {
...
@@ -37,5 +37,10 @@ module.exports = {
})
})
}
}
return
copyOptions
return
copyOptions
},
configureWebpack
()
{
return
{
devtool
:
process
.
env
.
NODE_ENV
===
'
production
'
?
false
:
'
source-map
'
}
}
}
}
}
packages/uni-mp-toutiao/lib/uni.config.js
浏览文件 @
05625834
...
@@ -13,5 +13,10 @@ module.exports = {
...
@@ -13,5 +13,10 @@ module.exports = {
},
},
copyWebpackOptions
(
platformOptions
,
vueOptions
)
{
copyWebpackOptions
(
platformOptions
,
vueOptions
)
{
return
[
'
ttcomponents
'
]
return
[
'
ttcomponents
'
]
},
configureWebpack
()
{
return
{
devtool
:
process
.
env
.
NODE_ENV
===
'
production
'
?
false
:
'
inline-source-map
'
}
}
}
}
}
packages/uni-mp-weixin/lib/uni.config.js
浏览文件 @
05625834
...
@@ -37,5 +37,10 @@ module.exports = {
...
@@ -37,5 +37,10 @@ module.exports = {
})
})
}
}
return
copyOptions
return
copyOptions
},
configureWebpack
()
{
return
{
devtool
:
process
.
env
.
NODE_ENV
===
'
production
'
?
false
:
'
source-map
'
}
}
}
}
}
packages/vue-cli-plugin-uni/index.js
浏览文件 @
05625834
...
@@ -64,10 +64,14 @@ module.exports = (api, options) => {
...
@@ -64,10 +64,14 @@ module.exports = (api, options) => {
api
.
chainWebpack
(
require
(
'
./lib/chain-webpack
'
)(
platformOptions
,
options
,
api
))
api
.
chainWebpack
(
require
(
'
./lib/chain-webpack
'
)(
platformOptions
,
options
,
api
))
global
.
uniPlugin
.
configureWebpack
.
forEach
(
configureWebpack
=>
{
global
.
uniPlugin
.
configureWebpack
.
forEach
(
configureWebpack
=>
{
api
.
configureWebpack
(
configureWebpack
)
api
.
configureWebpack
(
function
(
webpackConfig
)
{
return
configureWebpack
(
webpackConfig
,
options
)
})
})
})
global
.
uniPlugin
.
chainWebpack
.
forEach
(
chainWebpack
=>
{
global
.
uniPlugin
.
chainWebpack
.
forEach
(
chainWebpack
=>
{
api
.
chainWebpack
(
chainWebpack
)
api
.
chainWebpack
(
function
(
webpackConfig
)
{
return
chainWebpack
(
webpackConfig
,
options
)
})
})
})
if
(
if
(
...
...
packages/vue-cli-plugin-uni/lib/app-plus/index.js
浏览文件 @
05625834
...
@@ -78,12 +78,6 @@ const v3 = {
...
@@ -78,12 +78,6 @@ const v3 = {
webpackConfig
.
optimization
.
splitChunks
=
false
webpackConfig
.
optimization
.
splitChunks
=
false
}
}
let
devtool
=
false
if
(
isAppService
&&
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
devtool
=
'
eval-source-map
'
}
const
rules
=
[]
const
rules
=
[]
const
scriptLoaders
=
[]
const
scriptLoaders
=
[]
...
@@ -126,7 +120,6 @@ const v3 = {
...
@@ -126,7 +120,6 @@ const v3 = {
}
}
return
{
return
{
devtool
,
mode
:
process
.
env
.
NODE_ENV
===
'
production
'
?
'
production
'
:
'
development
'
,
mode
:
process
.
env
.
NODE_ENV
===
'
production
'
?
'
production
'
:
'
development
'
,
externals
:
{
externals
:
{
vue
:
'
Vue
'
vue
:
'
Vue
'
...
...
packages/vue-cli-plugin-uni/lib/copy-webpack-options.js
浏览文件 @
05625834
...
@@ -62,7 +62,6 @@ function getCopyWebpackPluginOptions (platformOptions, vueOptions) {
...
@@ -62,7 +62,6 @@ function getCopyWebpackPluginOptions (platformOptions, vueOptions) {
copyOption
&&
copyOptions
.
push
(
copyOption
)
copyOption
&&
copyOptions
.
push
(
copyOption
)
})
})
})
})
console
.
log
(
'
debug:::
'
,
copyOptions
)
return
copyOptions
return
copyOptions
}
}
...
...
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
05625834
...
@@ -17,7 +17,6 @@ process.env.UNI_INPUT_DIR = process.env.UNI_INPUT_DIR || path.resolve(process.cw
...
@@ -17,7 +17,6 @@ process.env.UNI_INPUT_DIR = process.env.UNI_INPUT_DIR || path.resolve(process.cw
// 初始化全局插件对象
// 初始化全局插件对象
global
.
uniPlugin
=
require
(
'
@dcloudio/uni-cli-shared/lib/plugin
'
).
init
()
global
.
uniPlugin
=
require
(
'
@dcloudio/uni-cli-shared/lib/plugin
'
).
init
()
console
.
log
(
'
debug:::
'
,
global
.
uniPlugin
)
const
manifestJsonObj
=
require
(
'
@dcloudio/uni-cli-shared/lib/manifest
'
).
getManifestJson
()
const
manifestJsonObj
=
require
(
'
@dcloudio/uni-cli-shared/lib/manifest
'
).
getManifestJson
()
const
platformOptions
=
manifestJsonObj
[
process
.
env
.
UNI_SUB_PLATFORM
||
process
.
env
.
UNI_PLATFORM
]
||
{}
const
platformOptions
=
manifestJsonObj
[
process
.
env
.
UNI_SUB_PLATFORM
||
process
.
env
.
UNI_PLATFORM
]
||
{}
// 插件校验环境
// 插件校验环境
...
...
packages/vue-cli-plugin-uni/lib/h5/index.js
浏览文件 @
05625834
...
@@ -102,7 +102,6 @@ module.exports = {
...
@@ -102,7 +102,6 @@ module.exports = {
`import 'uni-pages';import 'uni-
${
process
.
env
.
UNI_PLATFORM
}
';`
`import 'uni-pages';import 'uni-
${
process
.
env
.
UNI_PLATFORM
}
';`
return
{
return
{
devtool
:
process
.
env
.
NODE_ENV
===
'
production
'
?
false
:
'
cheap-module-eval-source-map
'
,
resolve
:
{
resolve
:
{
extensions
:
[
'
.nvue
'
],
extensions
:
[
'
.nvue
'
],
alias
:
{
alias
:
{
...
...
packages/vue-cli-plugin-uni/lib/mp/index.js
浏览文件 @
05625834
...
@@ -77,29 +77,11 @@ module.exports = {
...
@@ -77,29 +77,11 @@ module.exports = {
parseEntry
()
parseEntry
()
let
devtool
=
false
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
if
(
process
.
env
.
UNI_PLATFORM
===
'
app-plus
'
)
{
if
(
process
.
env
.
UNI_USING_V8
)
{
devtool
=
'
eval-source-map
'
}
else
{
devtool
=
'
eval
'
}
}
else
if
(
process
.
env
.
UNI_PLATFORM
===
'
mp-baidu
'
||
process
.
env
.
UNI_PLATFORM
===
'
mp-toutiao
'
)
{
devtool
=
'
inline-source-map
'
}
else
{
devtool
=
'
sourcemap
'
}
}
const
statCode
=
process
.
env
.
UNI_USING_STAT
?
`import '@dcloudio/uni-stat';`
:
''
const
statCode
=
process
.
env
.
UNI_USING_STAT
?
`import '@dcloudio/uni-stat';`
:
''
const
beforeCode
=
`import 'uni-pages';`
const
beforeCode
=
`import 'uni-pages';`
return
{
return
{
devtool
,
mode
:
process
.
env
.
NODE_ENV
===
'
production
'
?
'
production
'
:
'
development
'
,
mode
:
process
.
env
.
NODE_ENV
===
'
production
'
?
'
production
'
:
'
development
'
,
entry
()
{
entry
()
{
return
process
.
UNI_ENTRY
return
process
.
UNI_ENTRY
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录