Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
V
vue-cli-plugin-ts-multi-pages
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shangbj
vue-cli-plugin-ts-multi-pages
Commits
3d81a982
Commit
3d81a982
authored
Jul 08, 2020
by
shangbinjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改打包背景图为相对路径
parent
aee93c1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
build.js
commands/build.js
+3
-2
No files found.
commands/build.js
View file @
3d81a982
...
@@ -206,7 +206,7 @@ async function build (args, api, options) {
...
@@ -206,7 +206,7 @@ async function build (args, api, options) {
const
pagePath
=
"./src/pages/"
+
entry
const
pagePath
=
"./src/pages/"
+
entry
webpackConfig
.
entry
=
{}
webpackConfig
.
entry
=
{}
webpackConfig
.
entry
[
entry
]
=
pagePath
+
'/index.ts'
webpackConfig
.
entry
[
entry
]
=
pagePath
+
'/index.ts'
const
curPublicPath
=
webpackConfig
.
output
.
publicPath
//
const curPublicPath = webpackConfig.output.publicPath
webpackConfig
.
output
.
publicPath
=
''
webpackConfig
.
output
.
publicPath
=
''
webpackConfig
.
output
.
path
=
targetDir
webpackConfig
.
output
.
path
=
targetDir
for
(
let
item
of
webpackConfig
.
plugins
)
{
for
(
let
item
of
webpackConfig
.
plugins
)
{
...
@@ -221,7 +221,8 @@ async function build (args, api, options) {
...
@@ -221,7 +221,8 @@ async function build (args, api, options) {
if
(
item
.
test
.
toString
().
indexOf
(
'png|jp'
)
>=
0
){
if
(
item
.
test
.
toString
().
indexOf
(
'png|jp'
)
>=
0
){
for
(
const
itemChild
of
item
.
use
)
{
for
(
const
itemChild
of
item
.
use
)
{
if
(
itemChild
.
options
){
if
(
itemChild
.
options
){
itemChild
.
options
.
publicPath
=
curPublicPath
?
curPublicPath
.
indexOf
(
entry
)
<
0
?
curPublicPath
+
entry
:
curPublicPath
:
'/'
+
entry
itemChild
.
options
.
publicPath
=
'../'
// itemChild.options.publicPath = curPublicPath?curPublicPath.indexOf(entry)<0?curPublicPath+entry:curPublicPath:'/'+entry
break
break
}
}
}
}
...
...
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