From cd99590bfdd8e52e8b7417afbfb6aa4a3e160828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juho=20Veps=C3=A4l=C3=A4inen?= Date: Tue, 12 May 2020 11:14:59 +0300 Subject: [PATCH] fix(generateJSAttributes): Allow attributes to be undefined This is the same as for CSS as we cannot guarantee webpack is generating the files. --- src/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index cac4a26..7b5bc60 100644 --- a/src/index.ts +++ b/src/index.ts @@ -102,8 +102,12 @@ function generateJSReferences({ }: { files: string[]; publicPath: string; - attributes: Attributes; + attributes: Attributes | undefined; }): string { + if (!attributes) { + return ''; + } + return files .map( (file) =>