Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6d1548f8
Commit
6d1548f8
authored
Jan 03, 2018
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Webpack config for ConcatenatedModule
parent
b1e1990e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
config/webpack.config.js
config/webpack.config.js
+25
-5
No files found.
config/webpack.config.js
View file @
6d1548f8
'
use strict
'
;
var
crypto
=
require
(
'
crypto
'
);
var
fs
=
require
(
'
fs
'
);
var
path
=
require
(
'
path
'
);
var
webpack
=
require
(
'
webpack
'
);
...
...
@@ -179,15 +180,34 @@ var config = {
if
(
chunk
.
name
)
{
return
chunk
.
name
;
}
return
chunk
.
mapModules
((
m
)
=>
{
const
moduleNames
=
[];
function
collectModuleNames
(
m
)
{
// handle ConcatenatedModule which does not have resource nor context set
if
(
m
.
modules
)
{
m
.
modules
.
forEach
(
collectModuleNames
);
return
;
}
const
pagesBase
=
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts/pages
'
);
if
(
m
.
resource
.
indexOf
(
pagesBase
)
===
0
)
{
return
path
.
relative
(
pagesBase
,
m
.
resource
)
moduleNames
.
push
(
path
.
relative
(
pagesBase
,
m
.
resource
)
.
replace
(
/
\/
index
\.[
a-z
]
+$/
,
''
)
.
replace
(
/
\/
/g
,
'
__
'
);
.
replace
(
/
\/
/g
,
'
__
'
));
}
else
{
moduleNames
.
push
(
path
.
relative
(
m
.
context
,
m
.
resource
));
}
return
path
.
relative
(
m
.
context
,
m
.
resource
);
}).
join
(
'
_
'
);
}
chunk
.
forEachModule
(
collectModuleNames
);
const
hash
=
crypto
.
createHash
(
'
sha256
'
)
.
update
(
moduleNames
.
join
(
'
_
'
))
.
digest
(
'
hex
'
);
return
`
${
moduleNames
[
0
]}
-
${
hash
.
substr
(
0
,
6
)}
`
;
}),
// create cacheable common library bundle for all vue chunks
...
...
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