From 71bd8e3008d55b94b1a32347b47ad5754c54ba72 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 2 Sep 2017 18:56:03 -0400 Subject: [PATCH] use template strings to prevent sourcemaps breaking the code --- src/generators/dom/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generators/dom/index.ts b/src/generators/dom/index.ts index 1d1e8b2608..7fff508e6a 100644 --- a/src/generators/dom/index.ts +++ b/src/generators/dom/index.ts @@ -151,7 +151,7 @@ export default function dom( const anchor = generator.customElement ? `null` : `options.anchor || null`; const constructorBody = deindent` - ${options.dev && + ${options.dev && !generator.customElement && `if ( !options || (!options.target && !options._root) ) throw new Error( "'target' is a required option" );`} this.options = options; ${generator.usesRefs && `this.refs = {};`} @@ -186,7 +186,7 @@ export default function dom( ${generator.customElement ? deindent` this.attachShadow({ mode: 'open' }); - ${css && `this.shadowRoot.innerHTML = '';`} + ${css && `this.shadowRoot.innerHTML = \`\`;`} ` : (generator.stylesheet.hasStyles && options.css !== false && `if ( !document.getElementById( '${generator.stylesheet.id}-style' ) ) @add_css();`)