Commit 4e86a737 authored by Mike Greiling's avatar Mike Greiling

migrate pdf_viewer to dynamic import

parent e2c87838
import renderPDF from './pdf'; import renderPDF from './pdf';
document.addEventListener('DOMContentLoaded', renderPDF); export default renderPDF;
...@@ -35,6 +35,9 @@ export default class BlobViewer { ...@@ -35,6 +35,9 @@ export default class BlobViewer {
case 'notebook': case 'notebook':
initViewer(import(/* webpackChunkName: 'notebook_viewer' */ '../notebook_viewer')); initViewer(import(/* webpackChunkName: 'notebook_viewer' */ '../notebook_viewer'));
break; break;
case 'pdf':
initViewer(import(/* webpackChunkName: 'pdf_viewer' */ '../pdf_viewer'));
break;
default: default:
break; break;
} }
......
- 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 } } .file-content#js-pdf-viewer{ data: { endpoint: blob_raw_path } }
...@@ -45,7 +45,6 @@ function generateEntries() { ...@@ -45,7 +45,6 @@ function generateEntries() {
const manualEntries = { const manualEntries = {
monitoring: './monitoring/monitoring_bundle.js', monitoring: './monitoring/monitoring_bundle.js',
mr_notes: './mr_notes/index.js', mr_notes: './mr_notes/index.js',
pdf_viewer: './blob/pdf_viewer.js',
protected_branches: './protected_branches', protected_branches: './protected_branches',
registry_list: './registry/index.js', registry_list: './registry/index.js',
sketch_viewer: './blob/sketch_viewer.js', sketch_viewer: './blob/sketch_viewer.js',
...@@ -224,7 +223,6 @@ const config = { ...@@ -224,7 +223,6 @@ const config = {
chunks: [ chunks: [
'monitoring', 'monitoring',
'mr_notes', 'mr_notes',
'pdf_viewer',
'registry_list', 'registry_list',
'ide', 'ide',
], ],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment