migrate notebook_viewer to dynamic import

This commit is contained in:
Mike Greiling 2018-03-01 01:47:06 -06:00
parent 2d8966f7f5
commit e2c8783815
No known key found for this signature in database
GPG key ID: 0303DF507FA67596
4 changed files with 4 additions and 7 deletions

View file

@ -1,3 +1,3 @@
import renderNotebook from './notebook';
document.addEventListener('DOMContentLoaded', renderNotebook);
export default renderNotebook;

View file

@ -32,6 +32,9 @@ export default class BlobViewer {
case 'balsamiq':
initViewer(import(/* webpackChunkName: 'balsamiq_viewer' */ '../balsamiq_viewer'));
break;
case 'notebook':
initViewer(import(/* webpackChunkName: 'notebook_viewer' */ '../notebook_viewer'));
break;
default:
break;
}

View file

@ -1,5 +1 @@
- content_for :page_specific_javascripts do
= webpack_bundle_tag('common_vue')
= webpack_bundle_tag('notebook_viewer')
.file-content#js-notebook-viewer{ data: { endpoint: blob_raw_path } }

View file

@ -45,7 +45,6 @@ function generateEntries() {
const manualEntries = {
monitoring: './monitoring/monitoring_bundle.js',
mr_notes: './mr_notes/index.js',
notebook_viewer: './blob/notebook_viewer.js',
pdf_viewer: './blob/pdf_viewer.js',
protected_branches: './protected_branches',
registry_list: './registry/index.js',
@ -225,7 +224,6 @@ const config = {
chunks: [
'monitoring',
'mr_notes',
'notebook_viewer',
'pdf_viewer',
'registry_list',
'ide',