Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
supervise-wecom
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d8c2ae46
authored
May 29, 2026
by
Jaxon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
chron: 升级 webpack5
1 parent
1d0d0e7b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
34 deletions
.postcssrc.js
babel.config.js
package.json
pnpm-lock.yaml
vue.config.js
.postcssrc.js
View file @
d8c2ae4
...
...
@@ -6,7 +6,7 @@ module.exports = () => {
"autoprefixer"
:
{
overrideBrowserslist
:
[
"Android 4.1"
,
"iOS 7.1"
,
"Chrome > 31"
,
"ff > 31"
,
"ie >= 8"
],
},
"postcss-px-to-viewport"
:
{
"postcss-px-to-viewport
-8-plugin
"
:
{
viewportWidth
:
375
,
// 视窗的宽度,对应的是我们设计稿的宽度,一般是750
unitPrecision
:
3
,
// 指定`px`转换为视窗单位值的小数位数(很多时候无法整除)
viewportUnit
:
"vw"
,
// 指定需要转换成的视窗单位,建议使用vw
...
...
babel.config.js
View file @
d8c2ae4
...
...
@@ -17,6 +17,6 @@ if (IS_PROD) {
}
module
.
exports
=
{
presets
:
[[
"@vue/
cli-plugin-babel/preset
"
,
{
useBuiltIns
:
"usage"
,
corejs
:
3
}]],
presets
:
[[
"@vue/
babel-preset-app
"
,
{
useBuiltIns
:
"usage"
,
corejs
:
3
}]],
plugins
,
};
package.json
View file @
d8c2ae4
...
...
@@ -27,24 +27,26 @@
},
"devDependencies"
:
{
"@antfu/eslint-config"
:
"^6.7.3"
,
"@vue/cli-plugin-babel"
:
"~4.5.0"
,
"@vue/cli-plugin-router"
:
"~4.5.0"
,
"@vue/cli-plugin-vuex"
:
"~4.5.0"
,
"@vue/cli-service"
:
"~4.5.0"
,
"@vue/babel-preset-app"
:
"^5.0.8"
,
"@vue/cli-plugin-babel"
:
"~5.0.8"
,
"@vue/cli-plugin-router"
:
"~5.0.8"
,
"@vue/cli-plugin-vuex"
:
"~5.0.8"
,
"@vue/cli-service"
:
"~5.0.8"
,
"autoprefixer"
:
"^9.8.8"
,
"babel-eslint"
:
"^10.1.0"
,
"babel-plugin-import"
:
"^1.13.0"
,
"babel-plugin-transform-remove-console"
:
"^6.9.4"
,
"case-sensitive-paths-webpack-plugin"
:
"^2.4.0"
,
"eslint"
:
"^9.39.2"
,
"eslint-plugin-format"
:
"^1.2.0"
,
"less"
:
"^4.6.4"
,
"less-loader"
:
"^
7.3.0
"
,
"postcss-px-to-viewport
"
:
"^1.1.1
"
,
"less-loader"
:
"^
11.1.4
"
,
"postcss-px-to-viewport
-8-plugin"
:
"^1.2.5
"
,
"sass"
:
"^1.99.0"
,
"sass-loader"
:
"^
8.0.2
"
,
"sass-loader"
:
"^
13.3.3
"
,
"script-ext-html-webpack-plugin"
:
"^2.1.4"
,
"svg-sprite-loader"
:
"6.0.11"
,
"vue-loader"
:
"
^15.9.8
"
,
"vue-loader"
:
"
15.11.1
"
,
"vue-template-compiler"
:
"^2.6.11"
,
"webpack-bundle-analyzer"
:
"^3.8.0"
},
...
...
pnpm-lock.yaml
View file @
d8c2ae4
This diff could not be displayed because it is too large.
vue.config.js
View file @
d8c2ae4
...
...
@@ -2,6 +2,7 @@
const
path
=
require
(
"node:path"
);
const
defaultSettings
=
require
(
"./src/config/conf.js"
);
const
BundleAnalyzerPlugin
=
require
(
"webpack-bundle-analyzer"
).
BundleAnalyzerPlugin
;
const
CaseSensitivePathsPlugin
=
require
(
"case-sensitive-paths-webpack-plugin"
);
const
resolve
=
dir
=>
path
.
join
(
__dirname
,
dir
);
const
iconsPath
=
resolve
(
"src/assets/icons"
);
...
...
@@ -37,18 +38,13 @@ module.exports = {
lintOnSave
:
false
,
productionSourceMap
:
false
,
// 如果不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
devServer
:
{
disableHostCheck
:
true
,
port
:
9527
,
// 端口 dj-scrm-wx-work-lwk
// port: 9528, // 端口 dj-scrm-wx-work-main-lwk
open
:
false
,
// 启动后打开浏览器.
// public: 'http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main-zhangls/#/',
overlay
:
{
// 当出现编译器错误或警告时,在浏览器中显示全屏覆盖层
warnings
:
false
,
errors
:
true
,
client
:
{
overlay
:
{
warnings
:
false
,
errors
:
true
,
},
},
port
:
9527
,
// 端口 dj-scrm-wx-work-lwk
// proxy: {
// //配置跨域
// '/api': {
...
...
@@ -77,7 +73,7 @@ module.exports = {
scss
:
{
// 向全局sass样式传入共享的全局变量, $src可以配置图片cdn前缀
// 详情: https://cli.vuejs.org/guide/css.html#passing-options-to-pre-processor-loaders
prepend
Data
:
`
additional
Data
:
`
$cdn: "
${
defaultSettings
.
cdn
}
";
`
,
},
...
...
@@ -88,6 +84,7 @@ module.exports = {
config
.
resolve
.
modules
=
[
"node_modules"
,
"./src/assets/spritesmith"
];
const
Plugins
=
[
new
CaseSensitivePathsPlugin
(),
new
SpritesmithPlugin
({
// 引入图片文件夹
src
:
{
...
...
@@ -161,13 +158,18 @@ module.exports = {
// .set('plugins', resolve('src/components'))
// .set('utils', resolve('src/utils'))
/**
* 设置保留空格
* 设置保留空格
- 删除 thread-loader 避免 Vue 2.7 兼容性问题
*/
config
.
module
.
rule
(
"vue"
)
.
uses
.
clear
()
.
end
()
.
use
(
"vue-loader"
)
.
loader
(
"vue-loader"
)
.
tap
((
options
)
=>
{
options
=
options
||
{};
options
.
compilerOptions
=
options
.
compilerOptions
||
{};
options
.
compilerOptions
.
preserveWhitespace
=
true
;
return
options
;
})
...
...
@@ -184,19 +186,9 @@ module.exports = {
}
config
// https://webpack.js.org/configuration/devtool/#development
.
when
(
!
IS_PROD
,
config
=>
config
.
devtool
(
"cheap-source-map"
));
.
when
(
!
IS_PROD
,
config
=>
config
.
devtool
(
"cheap-
module-
source-map"
));
config
.
when
(
IS_PROD
,
(
config
)
=>
{
config
.
plugin
(
"ScriptExtHtmlWebpackPlugin"
)
.
after
(
"html"
)
.
use
(
"script-ext-html-webpack-plugin"
,
[
{
// 将 runtime 作为内联引入不单独存在
inline
:
/runtime
\.
.*
\.
js$/
,
},
])
.
end
();
config
.
optimization
.
splitChunks
({
chunks
:
"all"
,
cacheGroups
:
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment