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
5a3511ea
Commit
5a3511ea
authored
Feb 28, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prefer let and const in webpack config
parent
6e49a757
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
27 deletions
+27
-27
config/webpack.config.js
config/webpack.config.js
+27
-27
No files found.
config/webpack.config.js
View file @
5a3511ea
'
use strict
'
;
'
use strict
'
;
var
crypto
=
require
(
'
crypto
'
);
const
crypto
=
require
(
'
crypto
'
);
var
fs
=
require
(
'
fs
'
);
const
fs
=
require
(
'
fs
'
);
var
path
=
require
(
'
path
'
);
const
path
=
require
(
'
path
'
);
var
glob
=
require
(
'
glob
'
);
const
glob
=
require
(
'
glob
'
);
var
webpack
=
require
(
'
webpack
'
);
const
webpack
=
require
(
'
webpack
'
);
var
StatsWriterPlugin
=
require
(
'
webpack-stats-plugin
'
).
StatsWriterPlugin
;
const
StatsWriterPlugin
=
require
(
'
webpack-stats-plugin
'
).
StatsWriterPlugin
;
var
CopyWebpackPlugin
=
require
(
'
copy-webpack-plugin
'
);
const
CopyWebpackPlugin
=
require
(
'
copy-webpack-plugin
'
);
var
CompressionPlugin
=
require
(
'
compression-webpack-plugin
'
);
const
CompressionPlugin
=
require
(
'
compression-webpack-plugin
'
);
var
NameAllModulesPlugin
=
require
(
'
name-all-modules-plugin
'
);
const
NameAllModulesPlugin
=
require
(
'
name-all-modules-plugin
'
);
var
BundleAnalyzerPlugin
=
require
(
'
webpack-bundle-analyzer
'
).
BundleAnalyzerPlugin
;
const
BundleAnalyzerPlugin
=
require
(
'
webpack-bundle-analyzer
'
).
BundleAnalyzerPlugin
;
var
WatchMissingNodeModulesPlugin
=
require
(
'
react-dev-utils/WatchMissingNodeModulesPlugin
'
);
const
WatchMissingNodeModulesPlugin
=
require
(
'
react-dev-utils/WatchMissingNodeModulesPlugin
'
);
var
ROOT_PATH
=
path
.
resolve
(
__dirname
,
'
..
'
);
const
ROOT_PATH
=
path
.
resolve
(
__dirname
,
'
..
'
);
var
IS_PRODUCTION
=
process
.
env
.
NODE_ENV
===
'
production
'
;
const
IS_PRODUCTION
=
process
.
env
.
NODE_ENV
===
'
production
'
;
var
IS_DEV_SERVER
=
process
.
argv
.
join
(
'
'
).
indexOf
(
'
webpack-dev-server
'
)
!==
-
1
;
const
IS_DEV_SERVER
=
process
.
argv
.
join
(
'
'
).
indexOf
(
'
webpack-dev-server
'
)
!==
-
1
;
var
DEV_SERVER_HOST
=
process
.
env
.
DEV_SERVER_HOST
||
'
localhost
'
;
const
DEV_SERVER_HOST
=
process
.
env
.
DEV_SERVER_HOST
||
'
localhost
'
;
var
DEV_SERVER_PORT
=
parseInt
(
process
.
env
.
DEV_SERVER_PORT
,
10
)
||
3808
;
const
DEV_SERVER_PORT
=
parseInt
(
process
.
env
.
DEV_SERVER_PORT
,
10
)
||
3808
;
var
DEV_SERVER_LIVERELOAD
=
process
.
env
.
DEV_SERVER_LIVERELOAD
!==
'
false
'
;
const
DEV_SERVER_LIVERELOAD
=
process
.
env
.
DEV_SERVER_LIVERELOAD
!==
'
false
'
;
var
WEBPACK_REPORT
=
process
.
env
.
WEBPACK_REPORT
;
const
WEBPACK_REPORT
=
process
.
env
.
WEBPACK_REPORT
;
var
NO_COMPRESSION
=
process
.
env
.
NO_COMPRESSION
;
const
NO_COMPRESSION
=
process
.
env
.
NO_COMPRESSION
;
var
autoEntriesCount
=
0
;
let
autoEntriesCount
=
0
;
var
watchAutoEntries
=
[];
let
watchAutoEntries
=
[];
function
generateEntries
()
{
function
generateEntries
()
{
// generate automatic entry points
// generate automatic entry points
var
autoEntries
=
{};
const
autoEntries
=
{};
var
pageEntries
=
glob
.
sync
(
'
pages/**/index.js
'
,
{
cwd
:
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts
'
)
});
const
pageEntries
=
glob
.
sync
(
'
pages/**/index.js
'
,
{
cwd
:
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts
'
)
});
watchAutoEntries
=
[
watchAutoEntries
=
[
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts/pages/
'
),
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts/pages/
'
),
];
];
...
@@ -74,7 +74,7 @@ function generateEntries() {
...
@@ -74,7 +74,7 @@ function generateEntries() {
return
Object
.
assign
(
manualEntries
,
autoEntries
);
return
Object
.
assign
(
manualEntries
,
autoEntries
);
}
}
var
config
=
{
const
config
=
{
context
:
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts
'
),
context
:
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts
'
),
entry
:
generateEntries
,
entry
:
generateEntries
,
...
@@ -166,7 +166,7 @@ var config = {
...
@@ -166,7 +166,7 @@ var config = {
new
StatsWriterPlugin
({
new
StatsWriterPlugin
({
filename
:
'
manifest.json
'
,
filename
:
'
manifest.json
'
,
transform
:
function
(
data
,
opts
)
{
transform
:
function
(
data
,
opts
)
{
var
stats
=
opts
.
compiler
.
getStats
().
toJson
({
const
stats
=
opts
.
compiler
.
getStats
().
toJson
({
chunkModules
:
false
,
chunkModules
:
false
,
source
:
false
,
source
:
false
,
chunks
:
false
,
chunks
:
false
,
...
...
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