Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
5033032d59b0
Commit
25bed73e
authored
Mar 01, 2018
by
Mike Greiling
Browse files
migrate pdf_viewer to dynamic import
parent
b995baa3133a
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/assets/javascripts/blob/pdf_viewer.js
View file @
5033032d
import
renderPDF
from
'
./pdf
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
renderPDF
)
;
export
default
renderPDF
;
app/assets/javascripts/blob/viewer/index.js
View file @
5033032d
...
...
@@ -35,6 +35,9 @@ export default class BlobViewer {
case
'
notebook
'
:
initViewer
(
import
(
/* webpackChunkName: 'notebook_viewer' */
'
../notebook_viewer
'
));
break
;
case
'
pdf
'
:
initViewer
(
import
(
/* webpackChunkName: 'pdf_viewer' */
'
../pdf_viewer
'
));
break
;
default
:
break
;
}
...
...
app/views/projects/blob/viewers/_pdf.html.haml
View file @
5033032d
-
content_for
:page_specific_javascripts
do
=
webpack_bundle_tag
(
'common_vue'
)
=
webpack_bundle_tag
(
'pdf_viewer'
)
.file-content
#js-pdf-viewer
{
data:
{
endpoint:
blob_raw_path
}
}
config/webpack.config.js
View file @
5033032d
...
...
@@ -45,7 +45,6 @@ function generateEntries() {
const
manualEntries
=
{
monitoring
:
'
./monitoring/monitoring_bundle.js
'
,
mr_notes
:
'
./mr_notes/index.js
'
,
pdf_viewer
:
'
./blob/pdf_viewer.js
'
,
protected_branches
:
'
./protected_branches
'
,
registry_list
:
'
./registry/index.js
'
,
sketch_viewer
:
'
./blob/sketch_viewer.js
'
,
...
...
@@ -224,7 +223,6 @@ const config = {
chunks
:
[
'
monitoring
'
,
'
mr_notes
'
,
'
pdf_viewer
'
,
'
registry_list
'
,
'
ide
'
,
],
...
...
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