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
911869f9
Commit
911869f9
authored
Feb 22, 2018
by
Clement Ho
Committed by
Jacob Schatz
Feb 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Webpack auto include for EE imports
parent
3f38fb7a
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
23 additions
and
14 deletions
+23
-14
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+0
-5
config/webpack.config.js
config/webpack.config.js
+12
-6
ee/app/assets/javascripts/pages/projects/blame/show/index.js
ee/app/assets/javascripts/pages/projects/blame/show/index.js
+1
-0
ee/app/assets/javascripts/pages/projects/blob/show/index.js
ee/app/assets/javascripts/pages/projects/blob/show/index.js
+2
-1
ee/app/assets/javascripts/pages/projects/edit/index.js
ee/app/assets/javascripts/pages/projects/edit/index.js
+2
-2
ee/app/assets/javascripts/pages/projects/merge_requests/creations/new/index.js
...ipts/pages/projects/merge_requests/creations/new/index.js
+1
-0
ee/app/assets/javascripts/pages/projects/merge_requests/edit/index.js
...s/javascripts/pages/projects/merge_requests/edit/index.js
+1
-0
ee/app/assets/javascripts/pages/projects/milestones/show/index.js
...ssets/javascripts/pages/projects/milestones/show/index.js
+1
-0
ee/app/assets/javascripts/pages/projects/settings/repository/show/index.js
...ascripts/pages/projects/settings/repository/show/index.js
+1
-0
ee/app/assets/javascripts/pages/projects/show/index.js
ee/app/assets/javascripts/pages/projects/show/index.js
+1
-0
ee/app/assets/javascripts/pages/search/show/index.js
ee/app/assets/javascripts/pages/search/show/index.js
+1
-0
No files found.
app/assets/javascripts/dispatcher.js
View file @
911869f9
...
...
@@ -62,11 +62,6 @@ var Dispatcher;
case
'
projects:blame:show
'
:
shortcut_handler
=
true
;
break
;
case
'
projects:edit
'
:
import
(
/* webpackChunkName: "ee_projects_edit" */
'
ee/pages/projects/edit
'
)
.
then
(
callDefault
)
.
catch
(
fail
);
break
;
case
'
projects:tree:show
'
:
import
(
/* webpackChunkName: "ee_projects_edit" */
'
ee/pages/projects/tree/show
'
)
.
then
(
callDefault
)
...
...
config/webpack.config.js
View file @
911869f9
...
...
@@ -29,13 +29,19 @@ var pageEntries = glob.sync('pages/**/index.js', { cwd: path.join(ROOT_PATH, 'ap
var
dispatcher
=
fs
.
readFileSync
(
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts/dispatcher.js
'
)).
toString
();
var
dispatcherChunks
=
dispatcher
.
match
(
/
(?!
import
\(
'
)\.\/
pages
\/[^
'
]
+/g
);
pageEntries
.
forEach
((
path
)
=>
{
le
t
chunkPath
=
path
.
replace
(
/
\/
index
\.
js$/
,
''
);
if
(
!
dispatcherChunks
.
includes
(
'
./
'
+
chunkPath
))
{
le
t
chunkName
=
chunkPath
.
replace
(
/
\/
/g
,
'
.
'
);
autoEntries
[
chunkName
]
=
'
./
'
+
path
;
function
generateAutoEntries
(
path
,
prefix
=
'
.
'
)
{
cons
t
chunkPath
=
path
.
replace
(
/
\/
index
\.
js$/
,
''
);
if
(
!
dispatcherChunks
.
includes
(
`
${
prefix
}
/
${
chunkPath
}
`
))
{
cons
t
chunkName
=
chunkPath
.
replace
(
/
\/
/g
,
'
.
'
);
autoEntries
[
chunkName
]
=
`
${
prefix
}
/
${
path
}
`
;
}
});
}
pageEntries
.
forEach
((
path
)
=>
generateAutoEntries
(
path
));
// add and replace any ce entries with ee entries
const
eePageEntries
=
glob
.
sync
(
'
pages/**/index.js
'
,
{
cwd
:
path
.
join
(
ROOT_PATH
,
'
ee/app/assets/javascripts
'
)
});
eePageEntries
.
forEach
((
path
)
=>
generateAutoEntries
(
path
,
'
ee
'
));
// report our auto-generated bundle count
var
autoEntriesCount
=
Object
.
keys
(
autoEntries
).
length
;
...
...
ee/app/assets/javascripts/pages/projects/blame/show/index.js
View file @
911869f9
import
'
~/pages/projects/blame/show/index
'
;
import
initBlob
from
'
../../shared/init_blob
'
;
export
default
()
=>
initBlob
();
ee/app/assets/javascripts/pages/projects/blob/show/index.js
View file @
911869f9
import
'
~/pages/projects/blob/show/index
'
;
import
initBlob
from
'
../../shared/init_blob
'
;
export
default
()
=>
initBlob
()
;
export
default
initBlob
;
ee/app/assets/javascripts/pages/projects/edit/index.js
View file @
911869f9
...
...
@@ -5,11 +5,11 @@ import UserCallout from '~/user_callout';
import
groupsSelect
from
'
~/groups_select
'
;
import
ApproversSelect
from
'
ee/approvers_select
'
;
export
default
()
=>
{
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
new
UsersSelect
();
groupsSelect
();
new
UserCallout
({
className
:
'
js-service-desk-callout
'
});
new
UserCallout
({
className
:
'
js-mr-approval-callout
'
});
new
ApproversSelect
();
};
}
)
;
ee/app/assets/javascripts/pages/projects/merge_requests/creations/new/index.js
View file @
911869f9
import
'
~/pages/projects/merge_requests/creations/new/index
'
;
import
UserCallout
from
'
~/user_callout
'
;
import
initForm
from
'
../../shared/init_form
'
;
...
...
ee/app/assets/javascripts/pages/projects/merge_requests/edit/index.js
View file @
911869f9
import
'
~/pages/projects/merge_requests/edit/index
'
;
import
initForm
from
'
../shared/init_form
'
;
export
default
()
=>
initForm
();
ee/app/assets/javascripts/pages/projects/milestones/show/index.js
View file @
911869f9
import
'
~/pages/projects/milestones/show/index
'
;
import
UserCallout
from
'
~/user_callout
'
;
export
default
()
=>
new
UserCallout
();
ee/app/assets/javascripts/pages/projects/settings/repository/show/index.js
View file @
911869f9
import
'
~/pages/projects/settings/repository/show/index
'
;
import
UsersSelect
from
'
~/users_select
'
;
import
UserCallout
from
'
~/user_callout
'
;
...
...
ee/app/assets/javascripts/pages/projects/show/index.js
View file @
911869f9
import
'
~/pages/projects/show/index
'
;
import
initGeoInfoModal
from
'
../../../init_geo_info_modal
'
;
export
default
()
=>
initGeoInfoModal
();
ee/app/assets/javascripts/pages/search/show/index.js
View file @
911869f9
import
'
~/pages/search/show/index
'
;
import
UserCallout
from
'
~/user_callout
'
;
export
default
()
=>
new
UserCallout
();
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