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
a923a684
Commit
a923a684
authored
Mar 13, 2019
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve differences in Webpack config between CE and EE
parent
f06a649c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
13 deletions
+39
-13
config/webpack.config.js
config/webpack.config.js
+39
-13
No files found.
config/webpack.config.js
View file @
a923a684
const
fs
=
require
(
'
fs
'
);
const
path
=
require
(
'
path
'
);
const
path
=
require
(
'
path
'
);
const
glob
=
require
(
'
glob
'
);
const
glob
=
require
(
'
glob
'
);
const
webpack
=
require
(
'
webpack
'
);
const
webpack
=
require
(
'
webpack
'
);
...
@@ -11,6 +12,10 @@ const ROOT_PATH = path.resolve(__dirname, '..');
...
@@ -11,6 +12,10 @@ const ROOT_PATH = path.resolve(__dirname, '..');
const
CACHE_PATH
=
process
.
env
.
WEBPACK_CACHE_PATH
||
path
.
join
(
ROOT_PATH
,
'
tmp/cache
'
);
const
CACHE_PATH
=
process
.
env
.
WEBPACK_CACHE_PATH
||
path
.
join
(
ROOT_PATH
,
'
tmp/cache
'
);
const
IS_PRODUCTION
=
process
.
env
.
NODE_ENV
===
'
production
'
;
const
IS_PRODUCTION
=
process
.
env
.
NODE_ENV
===
'
production
'
;
const
IS_DEV_SERVER
=
process
.
argv
.
join
(
'
'
).
indexOf
(
'
webpack-dev-server
'
)
!==
-
1
;
const
IS_DEV_SERVER
=
process
.
argv
.
join
(
'
'
).
indexOf
(
'
webpack-dev-server
'
)
!==
-
1
;
const
IS_EE
=
process
.
env
.
EE
!==
undefined
?
JSON
.
parse
(
process
.
env
.
EE
)
:
fs
.
existsSync
(
path
.
join
(
ROOT_PATH
,
'
ee
'
));
const
DEV_SERVER_HOST
=
process
.
env
.
DEV_SERVER_HOST
||
'
localhost
'
;
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_PORT
=
parseInt
(
process
.
env
.
DEV_SERVER_PORT
,
10
)
||
3808
;
const
DEV_SERVER_LIVERELOAD
=
IS_DEV_SERVER
&&
process
.
env
.
DEV_SERVER_LIVERELOAD
!==
'
false
'
;
const
DEV_SERVER_LIVERELOAD
=
IS_DEV_SERVER
&&
process
.
env
.
DEV_SERVER_LIVERELOAD
!==
'
false
'
;
...
@@ -44,6 +49,14 @@ function generateEntries() {
...
@@ -44,6 +49,14 @@ function generateEntries() {
pageEntries
.
forEach
(
path
=>
generateAutoEntries
(
path
));
pageEntries
.
forEach
(
path
=>
generateAutoEntries
(
path
));
if
(
IS_EE
)
{
const
eePageEntries
=
glob
.
sync
(
'
pages/**/index.js
'
,
{
cwd
:
path
.
join
(
ROOT_PATH
,
'
ee/app/assets/javascripts
'
),
});
eePageEntries
.
forEach
(
path
=>
generateAutoEntries
(
path
,
'
ee
'
));
watchAutoEntries
.
push
(
path
.
join
(
ROOT_PATH
,
'
ee/app/assets/javascripts/pages/
'
));
}
const
autoEntryKeys
=
Object
.
keys
(
autoEntriesMap
);
const
autoEntryKeys
=
Object
.
keys
(
autoEntriesMap
);
autoEntriesCount
=
autoEntryKeys
.
length
;
autoEntriesCount
=
autoEntryKeys
.
length
;
...
@@ -68,6 +81,31 @@ function generateEntries() {
...
@@ -68,6 +81,31 @@ function generateEntries() {
return
Object
.
assign
(
manualEntries
,
autoEntries
);
return
Object
.
assign
(
manualEntries
,
autoEntries
);
}
}
const
alias
=
{
'
~
'
:
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts
'
),
emojis
:
path
.
join
(
ROOT_PATH
,
'
fixtures/emojis
'
),
empty_states
:
path
.
join
(
ROOT_PATH
,
'
app/views/shared/empty_states
'
),
icons
:
path
.
join
(
ROOT_PATH
,
'
app/views/shared/icons
'
),
images
:
path
.
join
(
ROOT_PATH
,
'
app/assets/images
'
),
vendor
:
path
.
join
(
ROOT_PATH
,
'
vendor/assets/javascripts
'
),
vue
$
:
'
vue/dist/vue.esm.js
'
,
spec
:
path
.
join
(
ROOT_PATH
,
'
spec/javascripts
'
),
// the following resolves files which are different between CE and EE
ee_else_ce
:
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts
'
),
};
if
(
IS_EE
)
{
Object
.
assign
(
alias
,
{
ee
:
path
.
join
(
ROOT_PATH
,
'
ee/app/assets/javascripts
'
),
ee_empty_states
:
path
.
join
(
ROOT_PATH
,
'
ee/app/views/shared/empty_states
'
),
ee_icons
:
path
.
join
(
ROOT_PATH
,
'
ee/app/views/shared/icons
'
),
ee_images
:
path
.
join
(
ROOT_PATH
,
'
ee/app/assets/images
'
),
ee_spec
:
path
.
join
(
ROOT_PATH
,
'
ee/spec/javascripts
'
),
ee_else_ce
:
path
.
join
(
ROOT_PATH
,
'
ee/app/assets/javascripts
'
),
});
}
module
.
exports
=
{
module
.
exports
=
{
mode
:
IS_PRODUCTION
?
'
production
'
:
'
development
'
,
mode
:
IS_PRODUCTION
?
'
production
'
:
'
development
'
,
...
@@ -85,19 +123,7 @@ module.exports = {
...
@@ -85,19 +123,7 @@ module.exports = {
resolve
:
{
resolve
:
{
extensions
:
[
'
.js
'
,
'
.gql
'
,
'
.graphql
'
],
extensions
:
[
'
.js
'
,
'
.gql
'
,
'
.graphql
'
],
alias
:
{
alias
,
'
~
'
:
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts
'
),
emojis
:
path
.
join
(
ROOT_PATH
,
'
fixtures/emojis
'
),
empty_states
:
path
.
join
(
ROOT_PATH
,
'
app/views/shared/empty_states
'
),
icons
:
path
.
join
(
ROOT_PATH
,
'
app/views/shared/icons
'
),
images
:
path
.
join
(
ROOT_PATH
,
'
app/assets/images
'
),
vendor
:
path
.
join
(
ROOT_PATH
,
'
vendor/assets/javascripts
'
),
vue
$
:
'
vue/dist/vue.esm.js
'
,
spec
:
path
.
join
(
ROOT_PATH
,
'
spec/javascripts
'
),
// the following resolves files which are different between CE and EE
ee_else_ce
:
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts
'
),
},
},
},
module
:
{
module
:
{
...
...
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