|
|
@@ -941,7 +941,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
|
|
|
|
|
|
async resolveHtmlImportURLs() {
|
|
|
const linkElements = Array.from(this.doc.querySelectorAll("link[rel=import][href]"));
|
|
|
- if (!this.relImportProcessors) {
|
|
|
+ if (!this.relImportProcessors && !this.options.removeImports) {
|
|
|
this.relImportProcessors = new Map();
|
|
|
}
|
|
|
await Promise.all(linkElements.map(async linkElement => {
|
|
|
@@ -963,7 +963,9 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
|
|
|
options.content = content;
|
|
|
if (!Util.testIgnoredPath(resourceURL) && Util.testValidPath(resourceURL)) {
|
|
|
const processor = new Runner(options);
|
|
|
- this.relImportProcessors.set(linkElement, processor);
|
|
|
+ if (!this.options.removeImports) {
|
|
|
+ this.relImportProcessors.set(linkElement, processor);
|
|
|
+ }
|
|
|
await processor.loadPage();
|
|
|
await processor.initialize();
|
|
|
processor.processor.stylesheets.forEach(stylesheet => {
|