|
|
@ -14,11 +14,9 @@ import Generator from '../Generator';
|
|
|
|
import Stylesheet from '../../css/Stylesheet';
|
|
|
|
import Stylesheet from '../../css/Stylesheet';
|
|
|
|
import preprocess from './preprocess';
|
|
|
|
import preprocess from './preprocess';
|
|
|
|
import Block from './Block';
|
|
|
|
import Block from './Block';
|
|
|
|
import { version } from '../../../package.json';
|
|
|
|
import { test } from '../../config';
|
|
|
|
import { Parsed, CompileOptions, Node } from '../../interfaces';
|
|
|
|
import { Parsed, CompileOptions, Node } from '../../interfaces';
|
|
|
|
|
|
|
|
|
|
|
|
const test = typeof global !== 'undefined' && global.__svelte_test;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export class DomGenerator extends Generator {
|
|
|
|
export class DomGenerator extends Generator {
|
|
|
|
blocks: (Block|string)[];
|
|
|
|
blocks: (Block|string)[];
|
|
|
|
readonly: Set<string>;
|
|
|
|
readonly: Set<string>;
|
|
|
@ -167,9 +165,9 @@ export default function dom(
|
|
|
|
builder.addBlock(block.toString());
|
|
|
|
builder.addBlock(block.toString());
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const sharedPath = options.shared === true
|
|
|
|
const sharedPath: string = options.shared === true
|
|
|
|
? 'svelte/shared.js'
|
|
|
|
? 'svelte/shared.js'
|
|
|
|
: options.shared;
|
|
|
|
: options.shared || '';
|
|
|
|
|
|
|
|
|
|
|
|
const prototypeBase =
|
|
|
|
const prototypeBase =
|
|
|
|
`${name}.prototype` +
|
|
|
|
`${name}.prototype` +
|
|
|
@ -444,7 +442,7 @@ export default function dom(
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
return generator.generate(result, options, {
|
|
|
|
return generator.generate(result, options, {
|
|
|
|
banner: `/* ${filename ? `${filename} ` : ``}generated by Svelte v${version} */`,
|
|
|
|
banner: `/* ${filename ? `${filename} ` : ``}generated by Svelte v__VERSION__ */`,
|
|
|
|
sharedPath,
|
|
|
|
sharedPath,
|
|
|
|
helpers,
|
|
|
|
helpers,
|
|
|
|
name,
|
|
|
|
name,
|
|
|
|