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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
a9a603e7
Commit
a9a603e7
authored
May 21, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert webpack.config.js
parent
fa04b50b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
28 deletions
+1
-28
config/webpack.config.js
config/webpack.config.js
+1
-28
No files found.
config/webpack.config.js
View file @
a9a603e7
...
...
@@ -2,7 +2,6 @@
var
fs
=
require
(
'
fs
'
);
var
path
=
require
(
'
path
'
);
var
execSync
=
require
(
'
child_process
'
).
execSync
;
var
webpack
=
require
(
'
webpack
'
);
var
StatsPlugin
=
require
(
'
stats-webpack-plugin
'
);
var
CompressionPlugin
=
require
(
'
compression-webpack-plugin
'
);
...
...
@@ -198,33 +197,7 @@ var config = {
}
}
function
getHeadCommitSHA
()
{
// Simple SHA validation.
// Match 5-40 numbers or lowercase letters between a and f.
const
SHA_REGEX
=
/^
\b[
0-9a-f
]{5,40}\b
$/
;
let
stdout
;
try
{
stdout
=
execSync
(
'
git rev-parse HEAD
'
);
}
catch
(
error
)
{
throw
error
;
}
const
headCommitSHA
=
stdout
.
trim
();
if
(
!
SHA_REGEX
.
test
(
headCommitSHA
))
{
throw
new
Error
(
`\`git rev-parse HEAD\` output is not a valid SHA1:
${
headCommitSHA
}
`
);
}
return
headCommitSHA
;
}
if
(
IS_PRODUCTION
)
{
const
processEnv
=
{
NODE_ENV
:
JSON
.
stringify
(
'
production
'
),
};
processEnv
.
HEAD_COMMIT_SHA
=
getHeadCommitSHA
();
config
.
devtool
=
'
source-map
'
;
config
.
plugins
.
push
(
new
webpack
.
NoEmitOnErrorsPlugin
(),
...
...
@@ -236,7 +209,7 @@ if (IS_PRODUCTION) {
sourceMap
:
true
}),
new
webpack
.
DefinePlugin
({
'
process.env
'
:
processEnv
,
'
process.env
'
:
{
NODE_ENV
:
JSON
.
stringify
(
'
production
'
)
}
}),
new
CompressionPlugin
({
asset
:
'
[path].gz[query]
'
,
...
...
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