diff --git a/src/loaders/pitcher.ts b/src/loaders/pitcher.ts index e5058d6..9175980 100644 --- a/src/loaders/pitcher.ts +++ b/src/loaders/pitcher.ts @@ -32,7 +32,9 @@ export const pitch = function (this: webpack.loader.LoaderContext, remainingRequ this.loaders.splice(templateLoaderIndex, 1) } // re-insert the template-loader in the right spot - this.loaders.splice(insertIndex + 1, 0, templateLoader) + if (templateLoader) { + this.loaders.splice(insertIndex + 1, 0, templateLoader) + } } } }