Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
4eb65072
Commit
4eb65072
authored
Jan 31, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改前端
parent
2aa748aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
62 deletions
+2
-62
base-manager-ui/admin/vue.config.js
base-manager-ui/admin/vue.config.js
+2
-62
No files found.
base-manager-ui/admin/vue.config.js
View file @
4eb65072
...
@@ -34,6 +34,8 @@ const assetsCDN = {
...
@@ -34,6 +34,8 @@ const assetsCDN = {
],
],
};
};
const
BundleAnalyzerPlugin
=
require
(
'
webpack-bundle-analyzer
'
).
BundleAnalyzerPlugin
const
BundleAnalyzerPlugin
=
require
(
'
webpack-bundle-analyzer
'
).
BundleAnalyzerPlugin
module
.
exports
=
{
module
.
exports
=
{
devServer
:
{
devServer
:
{
...
@@ -57,69 +59,7 @@ module.exports = {
...
@@ -57,69 +59,7 @@ module.exports = {
patterns
:
[
path
.
resolve
(
__dirname
,
"
./src/theme/theme.less
"
)],
patterns
:
[
path
.
resolve
(
__dirname
,
"
./src/theme/theme.less
"
)],
},
},
},
},
configureWebpack
:
(
config
)
=>
{
config
.
plugin
(
'
webpack-report
'
).
use
(
BundleAnalyzerPlugin
,
[
{
analyzerMode
:
'
static
'
}
])
plugins
:
process
.
env
.
NODE_ENV
===
"
production
"
?
[]
:
[...
devPlugins
];
config
.
entry
.
app
=
[
"
babel-polyfill
"
,
"
whatwg-fetch
"
,
"
./src/main.js
"
];
config
.
performance
=
{
hints
:
false
,
};
config
.
plugins
.
push
(
new
ThemeColorReplacer
({
fileName
:
"
css/theme-colors-[contenthash:8].css
"
,
matchColors
:
getThemeColors
(),
injectCss
:
true
,
resolveCss
,
})
);
config
.
plugins
.
push
(
// 控制富文本图片大小
new
webpack
.
ProvidePlugin
({
"
window.Quill
"
:
"
quill/dist/quill.js
"
,
Quill
:
"
quill/dist/quill.js
"
,
})
);
// Ignore all locale files of moment.js
// config.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/))
// 生产环境下将资源压缩成gzip格式
if
(
isProd
)
{
// add `CompressionWebpack` plugin to webpack plugins
config
.
plugins
.
push
(
new
CompressionWebpackPlugin
({
algorithm
:
"
gzip
"
,
test
:
new
RegExp
(
"
\\
.(
"
+
productionGzipExtensions
.
join
(
"
|
"
)
+
"
)$
"
),
threshold
:
10240
,
minRatio
:
0.8
,
})
);
}
// if prod, add externals
if
(
isProd
)
{
config
.
externals
=
assetsCDN
.
externals
;
}
},
chainWebpack
:
(
config
)
=>
{
// 生产环境下关闭css压缩的 colormin 项,因为此项优化与主题色替换功能冲突
if
(
isProd
)
{
config
.
plugin
(
"
optimize-css
"
).
tap
((
args
)
=>
{
args
[
0
].
cssnanoOptions
.
preset
[
1
].
colormin
=
false
;
return
args
;
});
}
// 生产环境下使用CDN
// if (isProd) {
// config.plugin('html')
// .tap(args => {
// args[0].cdn = assetsCDN
// return args
// })
// }
},
css
:
{
css
:
{
loaderOptions
:
{
loaderOptions
:
{
less
:
{
less
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment