diff --git a/packages/html/src/index.ts b/packages/html/src/index.ts
index c22650057..59d74bfcd 100644
--- a/packages/html/src/index.ts
+++ b/packages/html/src/index.ts
@@ -70,7 +70,7 @@ const defaultTemplate = async ({
const supportedFormats = ['es', 'esm', 'iife', 'umd'];
-const defaults = {
+const defaults: Required = {
attributes: {
link: null,
html: { lang: 'en' },
@@ -84,11 +84,8 @@ const defaults = {
};
export default function html(opts: RollupHtmlOptions = {}): Plugin {
- const { attributes, fileName, meta, publicPath, template, title } = Object.assign(
- {},
- defaults,
- opts
- );
+ const { attributes, fileName, meta, publicPath, template, title }: Required =
+ Object.assign({}, defaults, opts);
return {
name: 'html',
diff --git a/packages/html/types/index.d.ts b/packages/html/types/index.d.ts
index 715e9a03c..0b73a54f6 100644
--- a/packages/html/types/index.d.ts
+++ b/packages/html/types/index.d.ts
@@ -15,7 +15,7 @@ export interface RollupHtmlOptions {
fileName?: string;
meta?: Record[];
publicPath?: string;
- template?: (templateoptions: RollupHtmlTemplateOptions) => string;
+ template?: (templateoptions: RollupHtmlTemplateOptions) => string | Promise;
}
export function makeHtmlAttributes(attributes: Record): string;