reinstate banner

pull/3870/head
Richard Harris 5 years ago
parent f3650a6ff6
commit 11b55ada46

@ -240,8 +240,7 @@ export default class Component {
const { compile_options, name } = this;
const { format = 'esm' } = compile_options;
// TODO reinstate banner (along with fragment marker comments)
const banner = `/* ${this.file ? `${this.file} ` : ``}generated by Svelte v${'__VERSION__'} */`;
const banner = `${this.file ? `${this.file} ` : ``}generated by Svelte v${'__VERSION__'}`;
const program: any = { type: 'Program', body: result };

@ -44,7 +44,7 @@ function edit_source(source, sveltePath) {
function esm(
program: any,
name: Identifier,
_banner: string,
banner: string,
sveltePath: string,
internal_path: string,
helpers: Array<{ name: string; alias: Identifier }>,
@ -98,6 +98,8 @@ function esm(
};
program.body = b`
/* ${banner} */
${import_declaration}
${internal_globals}
${imports}
@ -112,7 +114,7 @@ function esm(
function cjs(
program: any,
name: Identifier,
_banner: string,
banner: string,
sveltePath: string,
internal_path: string,
helpers: Array<{ name: string; alias: Identifier }>,
@ -188,6 +190,8 @@ function cjs(
const exports = module_exports.map(x => b`exports.${{ type: 'Identifier', name: x.as }} = ${{ type: 'Identifier', name: x.name }};`);
program.body = b`
/* ${banner} */
"use strict";
${internal_requires}
${internal_globals}

Loading…
Cancel
Save