|
|
|
@ -14,7 +14,7 @@ import Stylesheet from './css/Stylesheet';
|
|
|
|
|
import { test } from '../config';
|
|
|
|
|
import Fragment from './nodes/Fragment';
|
|
|
|
|
import internal_exports from './internal_exports';
|
|
|
|
|
import { Ast, CompileOptions, Var, Warning } from '../interfaces';
|
|
|
|
|
import { Ast, CompileOptions, Var, Warning, CssResult } from '../interfaces';
|
|
|
|
|
import error from '../utils/error';
|
|
|
|
|
import get_code_frame from '../utils/get_code_frame';
|
|
|
|
|
import flatten_reference from './utils/flatten_reference';
|
|
|
|
@ -226,7 +226,7 @@ export default class Component {
|
|
|
|
|
return alias;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
generate(result?: Node[]) {
|
|
|
|
|
generate(result?: { js: Node[]; css: CssResult }) {
|
|
|
|
|
let js = null;
|
|
|
|
|
let css = null;
|
|
|
|
|
|
|
|
|
@ -236,7 +236,7 @@ export default class Component {
|
|
|
|
|
|
|
|
|
|
const banner = `${this.file ? `${this.file} ` : ``}generated by Svelte v${'__VERSION__'}`;
|
|
|
|
|
|
|
|
|
|
const program: any = { type: 'Program', body: result };
|
|
|
|
|
const program: any = { type: 'Program', body: result.js };
|
|
|
|
|
|
|
|
|
|
walk(program, {
|
|
|
|
|
enter: (node, parent, key) => {
|
|
|
|
@ -310,7 +310,7 @@ export default class Component {
|
|
|
|
|
|
|
|
|
|
css = compile_options.customElement
|
|
|
|
|
? { code: null, map: null }
|
|
|
|
|
: this.stylesheet.render(compile_options.cssOutputFilename, true);
|
|
|
|
|
: result.css;
|
|
|
|
|
|
|
|
|
|
js = print(program, {
|
|
|
|
|
sourceMapSource: compile_options.filename
|
|
|
|
@ -752,7 +752,7 @@ export default class Component {
|
|
|
|
|
|
|
|
|
|
if (map.has(node)) {
|
|
|
|
|
scope = scope.parent;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|