migrate pdf_viewer to dynamic import
This commit is contained in:
parent
e2c8783815
commit
4e86a7378c
4 changed files with 4 additions and 7 deletions
|
@ -1,3 +1,3 @@
|
|||
import renderPDF from './pdf';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', renderPDF);
|
||||
export default renderPDF;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1,5 +1 @@
|
|||
- 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 } }
|
||||
|
|
|
@ -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',
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue