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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
8ebe2f7a
Commit
8ebe2f7a
authored
Feb 01, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prevent dynamic chunks from being duplicated by the dispatcher until it is completely refactored
parent
dd75c337
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+3
-3
config/webpack.config.js
config/webpack.config.js
+13
-2
No files found.
app/assets/javascripts/dispatcher.js
View file @
8ebe2f7a
...
...
@@ -56,7 +56,7 @@ import SearchAutocomplete from './search_autocomplete';
break
;
case
'
projects:boards:show
'
:
case
'
projects:boards:index
'
:
import
(
'
./pages/projects/boards
/index
'
)
import
(
'
./pages/projects/boards
'
)
.
then
(
callDefault
)
.
catch
(
fail
);
shortcut_handler
=
true
;
...
...
@@ -363,7 +363,7 @@ import SearchAutocomplete from './search_autocomplete';
.
catch
(
fail
);
break
;
case
'
projects:project_members:index
'
:
import
(
'
./pages/projects/project_members
/
'
)
import
(
'
./pages/projects/project_members
'
)
.
then
(
callDefault
)
.
catch
(
fail
);
break
;
...
...
@@ -605,7 +605,7 @@ import SearchAutocomplete from './search_autocomplete';
}
break
;
case
'
profiles
'
:
import
(
'
./pages/profiles/index
/
'
)
import
(
'
./pages/profiles/index
'
)
.
then
(
callDefault
)
.
catch
(
fail
);
break
;
...
...
config/webpack.config.js
View file @
8ebe2f7a
...
...
@@ -25,11 +25,22 @@ var NO_COMPRESSION = process.env.NO_COMPRESSION;
var
autoEntries
=
{};
var
pageEntries
=
glob
.
sync
(
'
pages/**/index.js
'
,
{
cwd
:
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts
'
)
});
// filter out entries currently imported dynamically in dispatcher.js
var
dispatcher
=
fs
.
readFileSync
(
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts/dispatcher.js
'
)).
toString
();
var
dispatcherChunks
=
dispatcher
.
match
(
/
(?!
import
\(
'.
\/)
pages
\/[^
'
]
+/g
);
pageEntries
.
forEach
((
path
)
=>
{
let
chunkName
=
path
.
replace
(
/
\/
index
\.
js$/
,
''
).
replace
(
/
\/
/g
,
'
.
'
);
autoEntries
[
chunkName
]
=
'
./
'
+
path
;
let
chunkPath
=
path
.
replace
(
/
\/
index
\.
js$/
,
''
);
if
(
!
dispatcherChunks
.
includes
(
chunkPath
))
{
let
chunkName
=
chunkPath
.
replace
(
/
\/
/g
,
'
.
'
);
autoEntries
[
chunkName
]
=
'
./
'
+
path
;
}
});
// report our auto-generated bundle count
var
autoEntriesCount
=
Object
.
keys
(
autoEntries
).
length
;
console
.
log
(
`
${
autoEntriesCount
}
entries from '/pages' automatically added to webpack output.`
);
var
config
=
{
// because sqljs requires fs.
node
:
{
...
...
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