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
2994f8e4
Commit
2994f8e4
authored
Jul 22, 2021
by
Jeremy Wu
Committed by
Phil Hughes
Jul 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feat: JH assets compile updates
parent
a35e8a20
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
config/helpers/is_jh_env.js
config/helpers/is_jh_env.js
+15
-0
config/webpack.config.js
config/webpack.config.js
+19
-0
No files found.
config/helpers/is_jh_env.js
0 → 100644
View file @
2994f8e4
const
fs
=
require
(
'
fs
'
);
const
path
=
require
(
'
path
'
);
const
IS_EE
=
require
(
'
./is_ee_env
'
);
const
ROOT_PATH
=
path
.
resolve
(
__dirname
,
'
../..
'
);
// The `FOSS_ONLY` is always `string` or `nil`
// Thus the nil or empty string will result
// in using default value: false
//
// The behavior needs to be synchronised with
// lib/gitlab.rb: Gitlab.jh?
// Since IS_EE already satisifies the conditions of not being a FOSS_ONLY.
// const isFossOnly = JSON.parse(process.env.FOSS_ONLY || 'false');
module
.
exports
=
IS_EE
&&
fs
.
existsSync
(
path
.
join
(
ROOT_PATH
,
'
jh
'
));
config/webpack.config.js
View file @
2994f8e4
...
@@ -20,6 +20,7 @@ const WEBPACK_VERSION = require('webpack/package.json').version;
...
@@ -20,6 +20,7 @@ const WEBPACK_VERSION = require('webpack/package.json').version;
const
createIncrementalWebpackCompiler
=
require
(
'
./helpers/incremental_webpack_compiler
'
);
const
createIncrementalWebpackCompiler
=
require
(
'
./helpers/incremental_webpack_compiler
'
);
const
IS_EE
=
require
(
'
./helpers/is_ee_env
'
);
const
IS_EE
=
require
(
'
./helpers/is_ee_env
'
);
const
IS_JH
=
require
(
'
./helpers/is_jh_env
'
);
const
vendorDllHash
=
require
(
'
./helpers/vendor_dll_hash
'
);
const
vendorDllHash
=
require
(
'
./helpers/vendor_dll_hash
'
);
const
MonacoWebpackPlugin
=
require
(
'
./plugins/monaco_webpack
'
);
const
MonacoWebpackPlugin
=
require
(
'
./plugins/monaco_webpack
'
);
...
@@ -97,6 +98,14 @@ function generateEntries() {
...
@@ -97,6 +98,14 @@ function generateEntries() {
watchAutoEntries
.
push
(
path
.
join
(
ROOT_PATH
,
'
ee/app/assets/javascripts/pages/
'
));
watchAutoEntries
.
push
(
path
.
join
(
ROOT_PATH
,
'
ee/app/assets/javascripts/pages/
'
));
}
}
if
(
IS_JH
)
{
const
eePageEntries
=
glob
.
sync
(
'
pages/**/index.js
'
,
{
cwd
:
path
.
join
(
ROOT_PATH
,
'
jh/app/assets/javascripts
'
),
});
eePageEntries
.
forEach
((
entryPath
)
=>
generateAutoEntries
(
entryPath
,
'
jh
'
));
watchAutoEntries
.
push
(
path
.
join
(
ROOT_PATH
,
'
jh/app/assets/javascripts/pages/
'
));
}
const
autoEntryKeys
=
Object
.
keys
(
autoEntriesMap
);
const
autoEntryKeys
=
Object
.
keys
(
autoEntriesMap
);
autoEntriesCount
=
autoEntryKeys
.
length
;
autoEntriesCount
=
autoEntryKeys
.
length
;
...
@@ -168,6 +177,16 @@ if (IS_EE) {
...
@@ -168,6 +177,16 @@ if (IS_EE) {
});
});
}
}
if
(
IS_JH
)
{
Object
.
assign
(
alias
,
{
jh
:
path
.
join
(
ROOT_PATH
,
'
jh/app/assets/javascripts
'
),
jh_icons
:
path
.
join
(
ROOT_PATH
,
'
jh/app/views/shared/icons
'
),
jh_images
:
path
.
join
(
ROOT_PATH
,
'
jh/app/assets/images
'
),
jh_spec
:
path
.
join
(
ROOT_PATH
,
'
jh/spec/javascripts
'
),
jh_jest
:
path
.
join
(
ROOT_PATH
,
'
jh/spec/frontend
'
),
});
}
if
(
!
IS_PRODUCTION
)
{
if
(
!
IS_PRODUCTION
)
{
const
fixtureDir
=
IS_EE
?
'
fixtures-ee
'
:
'
fixtures
'
;
const
fixtureDir
=
IS_EE
?
'
fixtures-ee
'
:
'
fixtures
'
;
...
...
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