Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
uni-app
提交
d73fbc8c
U
uni-app
项目概览
Metz
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d73fbc8c
编写于
8月 08, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: lint
上级
b381a51d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
59 addition
and
59 deletion
+59
-59
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
+1
-1
packages/vue-cli-plugin-uni/commands/build.js
packages/vue-cli-plugin-uni/commands/build.js
+2
-2
packages/vue-cli-plugin-uni/commands/serve.js
packages/vue-cli-plugin-uni/commands/serve.js
+40
-40
packages/vue-cli-plugin-uni/lib/app-plus/index.js
packages/vue-cli-plugin-uni/lib/app-plus/index.js
+1
-1
packages/vue-cli-plugin-uni/lib/configure-webpack.js
packages/vue-cli-plugin-uni/lib/configure-webpack.js
+13
-13
packages/vue-cli-plugin-uni/lib/h5/cssnano-options.js
packages/vue-cli-plugin-uni/lib/h5/cssnano-options.js
+2
-2
未找到文件。
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
浏览文件 @
d73fbc8c
...
...
@@ -135,7 +135,7 @@ const rules = [{
babelrc
:
false
}
},
jsPreprocessorLoader
jsPreprocessorLoader
]
// exclude (modulePath) { // nvue js均提供babel,否则还得提供transpileDependencies配置
// return excludeModuleReg.test(modulePath) && modulePath.indexOf('@dcloudio') === -1
...
...
packages/vue-cli-plugin-uni/commands/build.js
浏览文件 @
d73fbc8c
...
...
@@ -100,7 +100,7 @@ function getWebpackConfig (api, args, options) {
modifyConfig
(
webpackConfig
,
config
=>
{
config
.
optimization
.
minimize
=
true
if
(
webpack
.
version
[
0
]
<=
4
)
{
config
.
optimization
.
namedModules
=
false
config
.
optimization
.
namedModules
=
false
}
})
}
else
{
...
...
@@ -109,7 +109,7 @@ function getWebpackConfig (api, args, options) {
config
.
optimization
=
{}
}
if
(
webpack
.
version
[
0
]
<=
4
)
{
config
.
optimization
.
namedModules
=
false
config
.
optimization
.
namedModules
=
false
}
})
}
...
...
packages/vue-cli-plugin-uni/commands/serve.js
浏览文件 @
d73fbc8c
...
...
@@ -172,8 +172,8 @@ module.exports = (api, options) => {
// launch editor support.
// this works with vue-devtools & @vue/cli-overlay
devServer
.
app
.
use
(
'
/__open-in-editor
'
,
launchEditorMiddleware
(()
=>
console
.
log
(
`To specify an editor, specify the EDITOR env variable or `
+
`add "editor" field to your Vue project config.\n`
'
To specify an editor, specify the EDITOR env variable or
'
+
'
add "editor" field to your Vue project config.
\n
'
)))
// allow other plugins to register middlewares, e.g. PWA
...
...
@@ -189,42 +189,42 @@ module.exports = (api, options) => {
}),
compiler
)
}
else
{
server
=
new
WebpackDevServer
(
compiler
,
Object
.
assign
({
clientLogLevel
:
'
none
'
,
historyApiFallback
:
{
disableDotRule
:
true
,
rewrites
:
[{
from
:
/./
,
to
:
path
.
posix
.
join
(
options
.
publicPath
,
'
index.html
'
)
}]
},
contentBase
:
api
.
resolve
(
'
public
'
),
watchContentBase
:
!
isProduction
,
hot
:
!
isProduction
,
quiet
:
true
,
compress
:
isProduction
,
publicPath
:
options
.
publicPath
,
overlay
:
isProduction
// TODO disable this
?
false
:
{
warnings
:
false
,
errors
:
true
}
},
projectDevServerOptions
,
{
https
:
useHttps
,
proxy
:
proxySettings
,
before
(
app
,
server
)
{
clientLogLevel
:
'
none
'
,
historyApiFallback
:
{
disableDotRule
:
true
,
rewrites
:
[{
from
:
/./
,
to
:
path
.
posix
.
join
(
options
.
publicPath
,
'
index.html
'
)
}]
},
contentBase
:
api
.
resolve
(
'
public
'
),
watchContentBase
:
!
isProduction
,
hot
:
!
isProduction
,
quiet
:
true
,
compress
:
isProduction
,
publicPath
:
options
.
publicPath
,
overlay
:
isProduction
// TODO disable this
?
false
:
{
warnings
:
false
,
errors
:
true
}
},
projectDevServerOptions
,
{
https
:
useHttps
,
proxy
:
proxySettings
,
before
(
app
,
server
)
{
// launch editor support.
// this works with vue-devtools & @vue/cli-overlay
app
.
use
(
'
/__open-in-editor
'
,
launchEditorMiddleware
(()
=>
console
.
log
(
'
To specify an editor, sepcify the EDITOR env variable or
'
+
app
.
use
(
'
/__open-in-editor
'
,
launchEditorMiddleware
(()
=>
console
.
log
(
'
To specify an editor, sepcify the EDITOR env variable or
'
+
'
add "editor" field to your Vue project config.
\n
'
)))
// allow other plugins to register middlewares, e.g. PWA
api
.
service
.
devServerConfigFns
.
forEach
(
fn
=>
fn
(
app
,
server
))
// apply in project middlewares
projectDevServerOptions
.
before
&&
projectDevServerOptions
.
before
(
app
,
server
)
}
}))
)))
// allow other plugins to register middlewares, e.g. PWA
api
.
service
.
devServerConfigFns
.
forEach
(
fn
=>
fn
(
app
,
server
))
// apply in project middlewares
projectDevServerOptions
.
before
&&
projectDevServerOptions
.
before
(
app
,
server
)
}
}))
}
;
...
...
@@ -356,11 +356,11 @@ module.exports = (api, options) => {
if
(
webpack
.
version
[
0
]
>
4
)
{
server
.
start
().
catch
(
err
=>
reject
(
err
))
}
else
{
server
.
listen
(
port
,
host
,
err
=>
{
if
(
err
)
{
reject
(
err
)
}
})
server
.
listen
(
port
,
host
,
err
=>
{
if
(
err
)
{
reject
(
err
)
}
})
}
})
})
...
...
packages/vue-cli-plugin-uni/lib/app-plus/index.js
浏览文件 @
d73fbc8c
...
...
@@ -139,7 +139,7 @@ const v3 = {
filename
:
'
[name].js
'
,
chunkFilename
:
'
[id].js
'
,
// webpack5 use strict
globalObject
:
webpack
.
version
[
0
]
>
4
?
`(new Function("return this")())`
:
'
this
'
globalObject
:
webpack
.
version
[
0
]
>
4
?
'
(new Function("return this")())
'
:
'
this
'
},
performance
:
{
hints
:
false
...
...
packages/vue-cli-plugin-uni/lib/configure-webpack.js
浏览文件 @
d73fbc8c
...
...
@@ -70,15 +70,15 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
return
rules
.
length
>
0
&&
rule
.
use
}
else
{
const
RuleSet
=
require
(
'
webpack/lib/RuleSet
'
)
const
normalized
=
RuleSet
.
normalizeRule
(
clone
,
{},
''
)
return
(
!
rule
.
enforce
&&
const
normalized
=
RuleSet
.
normalizeRule
(
clone
,
{},
''
)
return
(
!
rule
.
enforce
&&
normalized
.
resource
&&
normalized
.
resource
(
fakeFile
)
)
)
}
}
}
}
function
updateJsLoader
(
rawRules
,
fakeFile
,
checkLoaderRegex
,
loader
)
{
const
matchRule
=
rawRules
.
find
(
createMatcher
(
fakeFile
))
...
...
@@ -185,18 +185,18 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
if
(
uses
.
find
(
use
=>
babelLoaderRe
.
test
(
use
.
loader
)))
{
const
index
=
uses
.
findIndex
(
use
=>
cacheLoaderRe
.
test
(
use
.
loader
))
if
(
index
>=
0
)
{
if
(
process
.
env
.
UNI_USING_CACHE
)
{
Object
.
assign
(
uses
[
index
].
options
,
api
.
genCacheConfig
(
'
babel-loader/
'
+
process
.
env
.
UNI_PLATFORM
,
getPartialIdentifier
()
))
}
else
{
uses
.
splice
(
index
,
1
)
if
(
process
.
env
.
UNI_USING_CACHE
)
{
Object
.
assign
(
uses
[
index
].
options
,
api
.
genCacheConfig
(
'
babel-loader/
'
+
process
.
env
.
UNI_PLATFORM
,
getPartialIdentifier
()
))
}
else
{
uses
.
splice
(
index
,
1
)
}
}
}
}
}
}
// js preprocess
updateJsLoader
(
rawRules
,
'
foo.js
'
,
babelLoaderRe
,
{
...
...
packages/vue-cli-plugin-uni/lib/h5/cssnano-options.js
浏览文件 @
d73fbc8c
...
...
@@ -11,8 +11,8 @@ module.exports = function initCssnanoOptions (webpackConfig) {
}
const
plugins
=
[
require
(
'
cssnano
'
)({
preset
:
[
'
default
'
,
getPlatformCssnano
()]
})]
preset
:
[
'
default
'
,
getPlatformCssnano
()]
})]
// TODO postcss-loader version > 4
if
(
webpack
.
version
[
0
]
>
4
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录