Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
scrm-wx-merchant-activity
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 2daa6e4b
authored
Sep 23, 2022
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1
1 parent
c2e7535e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
vue.config.js
vue.config.js
View file @
2daa6e4
...
...
@@ -27,7 +27,6 @@ const cdn = {
'https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.2/libs/flv.min.1.6.2.js'
,
'//web.sdk.qcloud.com/player/tcplayer/release/v4.5.2/tcplayer.v4.5.2.min.js'
]
}
/**
...
...
@@ -37,14 +36,16 @@ const SpritesmithPlugin = require('webpack-spritesmith')
const
spritesmithFunction
=
data
=>
{
let
{
spritesheet
,
sprites
}
=
data
let
shared
=
`.sprite-icon { background-image: url(
${
data
.
sprites
[
0
].
image
}
);background-size:
${
spritesheet
.
width
/
2
}
px
${
spritesheet
.
height
/
2
}
px;}`
let
perSprite
=
sprites
.
map
(
sprite
=>
{
let
perSprite
=
sprites
.
map
(
sprite
=>
{
let
{
name
,
width
,
height
,
offset_x
,
offset_y
}
=
sprite
return
`.icon-
${
name
}
{ width:
${
width
/
2
}
px; height:
${
height
/
2
}
px; background-position:
${
offset_x
/
2
}
px
${
offset_y
/
2
}
px;}`
}).
join
(
'\n'
)
})
.
join
(
'\n'
)
return
`
${
shared
}
\n
${
perSprite
}
`
}
module
.
exports
=
{
publicPath
:
IS_PROD
?
'./'
:
'/dj-scrm-wx-work-main-l
wk
/'
,
// 本地调试时需登录时使用
publicPath
:
IS_PROD
?
'./'
:
'/dj-scrm-wx-work-main-l
m
/'
,
// 本地调试时需登录时使用
// publicPath: './',
// publicPath: '/dj-scrm-wx-work-attachment-activity/', // 署应用包时的基本 URL。 vue-router history模式使用
outputDir
:
'dist'
,
// 生产环境构建文件的目录
...
...
@@ -53,6 +54,7 @@ module.exports = {
productionSourceMap
:
false
,
// 如果不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
devServer
:
{
disableHostCheck
:
true
,
// host: `192.168.2.222`,
port
:
9528
,
// 端口
open
:
false
,
// 启动后打开浏览器
public
:
'http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main/#/'
,
...
...
@@ -101,13 +103,16 @@ module.exports = {
image
:
path
.
resolve
(
__dirname
,
'./src/assets/images/sprite.png'
),
// 生成SCSS
css
:
[
[
path
.
resolve
(
__dirname
,
'./src/assets/css/sprite.scss'
),
{
[
path
.
resolve
(
__dirname
,
'./src/assets/css/sprite.scss'
),
{
format
:
'function_based_template'
}]
}
]
]
},
customTemplates
:
{
'function_based_template'
:
spritesmithFunction
,
function_based_template
:
spritesmithFunction
},
//background引用路径
apiOptions
:
{
...
...
@@ -165,9 +170,11 @@ module.exports = {
* 打包分析
*/
if
(
IS_PROD
)
{
config
.
plugin
(
'webpack-report'
).
use
(
BundleAnalyzerPlugin
,
[{
config
.
plugin
(
'webpack-report'
).
use
(
BundleAnalyzerPlugin
,
[
{
analyzerMode
:
'static'
}])
}
])
}
config
// https://webpack.js.org/configuration/devtool/#development
...
...
@@ -177,10 +184,12 @@ module.exports = {
config
.
plugin
(
'ScriptExtHtmlWebpackPlugin'
)
.
after
(
'html'
)
.
use
(
'script-ext-html-webpack-plugin'
,
[{
.
use
(
'script-ext-html-webpack-plugin'
,
[
{
// 将 runtime 作为内联引入不单独存在
inline
:
/runtime
\.
.*
\.
js$/
}])
}
])
.
end
()
config
.
optimization
.
splitChunks
({
chunks
:
'all'
,
...
...
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