BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
5a3511ea
Unverified
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
27 deletions
+27
-27
webpack.config.js
config/webpack.config.js
+27
-27
No files found.
config/webpack.config.js
View file @
5a3511ea
'use strict'
;
var
crypto
=
require
(
'crypto'
);
var
fs
=
require
(
'fs'
);
var
path
=
require
(
'path'
);
var
glob
=
require
(
'glob'
);
var
webpack
=
require
(
'webpack'
);
var
StatsWriterPlugin
=
require
(
'webpack-stats-plugin'
).
StatsWriterPlugin
;
var
CopyWebpackPlugin
=
require
(
'copy-webpack-plugin'
);
var
CompressionPlugin
=
require
(
'compression-webpack-plugin'
);
var
NameAllModulesPlugin
=
require
(
'name-all-modules-plugin'
);
var
BundleAnalyzerPlugin
=
require
(
'webpack-bundle-analyzer'
).
BundleAnalyzerPlugin
;
var
WatchMissingNodeModulesPlugin
=
require
(
'react-dev-utils/WatchMissingNodeModulesPlugin'
);
var
ROOT_PATH
=
path
.
resolve
(
__dirname
,
'..'
);
var
IS_PRODUCTION
=
process
.
env
.
NODE_ENV
===
'production'
;
var
IS_DEV_SERVER
=
process
.
argv
.
join
(
' '
).
indexOf
(
'webpack-dev-server'
)
!==
-
1
;
var
DEV_SERVER_HOST
=
process
.
env
.
DEV_SERVER_HOST
||
'localhost'
;
var
DEV_SERVER_PORT
=
parseInt
(
process
.
env
.
DEV_SERVER_PORT
,
10
)
||
3808
;
var
DEV_SERVER_LIVERELOAD
=
process
.
env
.
DEV_SERVER_LIVERELOAD
!==
'false'
;
var
WEBPACK_REPORT
=
process
.
env
.
WEBPACK_REPORT
;
var
NO_COMPRESSION
=
process
.
env
.
NO_COMPRESSION
;
var
autoEntriesCount
=
0
;
var
watchAutoEntries
=
[];
const
crypto
=
require
(
'crypto'
);
const
fs
=
require
(
'fs'
);
const
path
=
require
(
'path'
);
const
glob
=
require
(
'glob'
);
const
webpack
=
require
(
'webpack'
);
const
StatsWriterPlugin
=
require
(
'webpack-stats-plugin'
).
StatsWriterPlugin
;
const
CopyWebpackPlugin
=
require
(
'copy-webpack-plugin'
);
const
CompressionPlugin
=
require
(
'compression-webpack-plugin'
);
const
NameAllModulesPlugin
=
require
(
'name-all-modules-plugin'
);
const
BundleAnalyzerPlugin
=
require
(
'webpack-bundle-analyzer'
).
BundleAnalyzerPlugin
;
const
WatchMissingNodeModulesPlugin
=
require
(
'react-dev-utils/WatchMissingNodeModulesPlugin'
);
const
ROOT_PATH
=
path
.
resolve
(
__dirname
,
'..'
);
const
IS_PRODUCTION
=
process
.
env
.
NODE_ENV
===
'production'
;
const
IS_DEV_SERVER
=
process
.
argv
.
join
(
' '
).
indexOf
(
'webpack-dev-server'
)
!==
-
1
;
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
=
process
.
env
.
DEV_SERVER_LIVERELOAD
!==
'false'
;
const
WEBPACK_REPORT
=
process
.
env
.
WEBPACK_REPORT
;
const
NO_COMPRESSION
=
process
.
env
.
NO_COMPRESSION
;
let
autoEntriesCount
=
0
;
let
watchAutoEntries
=
[];
function
generateEntries
()
{
// generate automatic entry points
var
autoEntries
=
{};
var
pageEntries
=
glob
.
sync
(
'pages/**/index.js'
,
{
cwd
:
path
.
join
(
ROOT_PATH
,
'app/assets/javascripts'
)
});
const
autoEntries
=
{};
const
pageEntries
=
glob
.
sync
(
'pages/**/index.js'
,
{
cwd
:
path
.
join
(
ROOT_PATH
,
'app/assets/javascripts'
)
});
watchAutoEntries
=
[
path
.
join
(
ROOT_PATH
,
'app/assets/javascripts/pages/'
),
];
...
...
@@ -74,7 +74,7 @@ function generateEntries() {
return
Object
.
assign
(
manualEntries
,
autoEntries
);
}
var
config
=
{
const
config
=
{
context
:
path
.
join
(
ROOT_PATH
,
'app/assets/javascripts'
),
entry
:
generateEntries
,
...
...
@@ -166,7 +166,7 @@ var config = {
new
StatsWriterPlugin
({
filename
:
'manifest.json'
,
transform
:
function
(
data
,
opts
)
{
var
stats
=
opts
.
compiler
.
getStats
().
toJson
({
const
stats
=
opts
.
compiler
.
getStats
().
toJson
({
chunkModules
:
false
,
source
:
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