diff --git a/src/editor.vue b/src/editor.vue index 1b5c31c..b0ca623 100644 --- a/src/editor.vue +++ b/src/editor.vue @@ -92,8 +92,8 @@ require('codemirror-asciidoc'); const registry = asciidoctor().Extensions.create(); highlightJsExt.register(registry); if (navigator.userAgent.toLowerCase().indexOf('safari') === -1 || navigator.userAgent.toLowerCase().indexOf('chrome') > -1) { - const kroki = require('../node_modules/asciidoctor-kroki/dist/browser/asciidoctor-kroki'); - kroki.register(registry); + import(/* webpackChunkName: "kroki" */ '../node_modules/asciidoctor-kroki/dist/browser/asciidoctor-kroki') + .then((value) => value.register(registry)); } const asciidoctorOptions = { diff --git a/src/scratch.vue b/src/scratch.vue index c78238b..e6f3cca 100644 --- a/src/scratch.vue +++ b/src/scratch.vue @@ -55,8 +55,8 @@ require('codemirror-asciidoc'); const registry = asciidoctor().Extensions.create(); highlightJsExt.register(registry); if (navigator.userAgent.toLowerCase().indexOf('safari') === -1 || navigator.userAgent.toLowerCase().indexOf('chrome') > -1) { - const kroki = require('../node_modules/asciidoctor-kroki/dist/browser/asciidoctor-kroki'); - kroki.register(registry); + import(/* webpackChunkName: "kroki" */ '../node_modules/asciidoctor-kroki/dist/browser/asciidoctor-kroki') + .then((value) => value.register(registry)); } const asciidoctorOptions = { diff --git a/src/start.vue b/src/start.vue index e6b8eaa..8497dae 100644 --- a/src/start.vue +++ b/src/start.vue @@ -131,8 +131,8 @@ import axios from 'axios'; const registry = asciidoctor().Extensions.create(); if (navigator.userAgent.toLowerCase().indexOf('safari') === -1 || navigator.userAgent.toLowerCase().indexOf('chrome') > -1) { - const kroki = require('../node_modules/asciidoctor-kroki/dist/browser/asciidoctor-kroki'); - kroki.register(registry); + import(/* webpackChunkName: "kroki" */ '../node_modules/asciidoctor-kroki/dist/browser/asciidoctor-kroki') + .then((value) => value.register(registry)); } const options = {