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
6312ab4d
Commit
6312ab4d
authored
Sep 11, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
a4cc50c8
c256adb7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
.gitlab/ci/frontend.gitlab-ci.yml
.gitlab/ci/frontend.gitlab-ci.yml
+14
-0
config/webpack.config.js
config/webpack.config.js
+25
-0
No files found.
.gitlab/ci/frontend.gitlab-ci.yml
View file @
6312ab4d
...
...
@@ -232,3 +232,17 @@ qa-frontend-node:latest:
extends
:
.qa-frontend-node
image
:
node:latest
allow_failure
:
true
webpack-dev-server
:
extends
:
-
.default-tags
-
.default-retry
-
.default-cache
-
.except-docs-qa
dependencies
:
[
"
compile-assets"
,
"
compile-assets
pull-cache"
,
"
setup-test-env"
]
variables
:
SETUP_DB
:
"
false"
WEBPACK_MEMORY_TEST
:
"
true"
script
:
-
node --version
-
node --expose-gc node_modules/.bin/webpack-dev-server --config config/webpack.config.js
config/webpack.config.js
View file @
6312ab4d
...
...
@@ -17,6 +17,7 @@ const DEV_SERVER_HOST = process.env.DEV_SERVER_HOST || 'localhost';
const
DEV_SERVER_PORT
=
parseInt
(
process
.
env
.
DEV_SERVER_PORT
,
10
)
||
3808
;
const
DEV_SERVER_LIVERELOAD
=
IS_DEV_SERVER
&&
process
.
env
.
DEV_SERVER_LIVERELOAD
!==
'
false
'
;
const
WEBPACK_REPORT
=
process
.
env
.
WEBPACK_REPORT
;
const
WEBPACK_MEMORY_TEST
=
process
.
env
.
WEBPACK_MEMORY_TEST
;
const
NO_COMPRESSION
=
process
.
env
.
NO_COMPRESSION
;
const
NO_SOURCEMAPS
=
process
.
env
.
NO_SOURCEMAPS
;
...
...
@@ -337,6 +338,30 @@ module.exports = {
},
},
// output the in-memory heap size upon compilation and exit
WEBPACK_MEMORY_TEST
&&
{
apply
(
compiler
)
{
compiler
.
hooks
.
emit
.
tapAsync
(
'
ReportMemoryConsumptionPlugin
'
,
(
compilation
,
callback
)
=>
{
console
.
log
(
'
Assets compiled...
'
);
if
(
global
.
gc
)
{
console
.
log
(
'
Running garbage collection...
'
);
global
.
gc
();
}
else
{
console
.
error
(
"
WARNING: you must use the --expose-gc node option to accurately measure webpack's heap size
"
,
);
}
const
memoryUsage
=
process
.
memoryUsage
().
heapUsed
;
const
toMB
=
bytes
=>
Math
.
floor
(
bytes
/
1024
/
1024
);
console
.
log
(
`Webpack heap size:
${
toMB
(
memoryUsage
)}
MB`
);
// exit in case we're running webpack-dev-server
IS_DEV_SERVER
&&
process
.
exit
();
});
},
},
// enable HMR only in webpack-dev-server
DEV_SERVER_LIVERELOAD
&&
new
webpack
.
HotModuleReplacementPlugin
(),
...
...
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