pull/6835/head
Conduitry 5 years ago
parent ea2854ae73
commit 5544b15c33

@ -343,10 +343,10 @@ export default class Component {
css = compile_options.customElement
? { code: null, map: null }
: result.css;
const jsSourcemapEnabled = check_enable_sourcemap(compile_options.enableSourcemap, 'js');
if (!jsSourcemapEnabled) {
const js_sourcemap_enabled = check_enable_sourcemap(compile_options.enableSourcemap, 'js');
if (!js_sourcemap_enabled) {
js = print(program);
js.map = null;
} else {

@ -34,16 +34,16 @@ export default function dom(
}
const css = component.stylesheet.render(options.filename, !options.customElement);
const cssSourcemapEnabled = check_enable_sourcemap(options.enableSourcemap, 'css');
if (cssSourcemapEnabled) {
const css_sourcemap_enabled = check_enable_sourcemap(options.enableSourcemap, 'css');
if (css_sourcemap_enabled) {
css.map = apply_preprocessor_sourcemap(options.filename, css.map, options.sourcemap as string | RawSourceMap | DecodedSourceMap);
} else {
css.map = null;
}
const styles = cssSourcemapEnabled && component.stylesheet.has_styles && options.dev
const styles = css_sourcemap_enabled && component.stylesheet.has_styles && options.dev
? `${css.code}\n/*# sourceMappingURL=${css.map.toUrl()} */`
: css.code;
@ -528,7 +528,7 @@ export default function dom(
constructor(options) {
super();
${css.code && b`this.shadowRoot.innerHTML = \`<style>${css.code.replace(/\\/g, '\\\\')}${cssSourcemapEnabled && options.dev ? `\n/*# sourceMappingURL=${css.map.toUrl()} */` : ''}</style>\`;`}
${css.code && b`this.shadowRoot.innerHTML = \`<style>${css.code.replace(/\\/g, '\\\\')}${css_sourcemap_enabled && options.dev ? `\n/*# sourceMappingURL=${css.map.toUrl()} */` : ''}</style>\`;`}
@init(this, { target: this.shadowRoot, props: ${init_props}, customElement: true }, ${definition}, ${has_create_fragment ? 'create_fragment' : 'null'}, ${not_equal}, ${prop_indexes}, null, ${dirty});

@ -201,13 +201,13 @@ export default function ssr(
main
].filter(Boolean);
const cssSourcemapEnabled = check_enable_sourcemap(options.enableSourcemap, 'css');
const css_sourcemap_enabled = check_enable_sourcemap(options.enableSourcemap, 'css');
const js = b`
${css.code ? b`
const #css = {
code: "${css.code}",
map: ${cssSourcemapEnabled && css.map ? string_literal(css.map.toString()) : 'null'}
map: ${css_sourcemap_enabled && css.map ? string_literal(css.map.toString()) : 'null'}
};` : null}
${component.extract_javascript(component.ast.module)}

Loading…
Cancel
Save