| | |
| | | } |
| | | |
| | | function joinScripts(scripts: string[]): string { |
| | | return scripts.join("\n") |
| | | // wrap with iife to prevent scope collision |
| | | return scripts.map(script => `(function () {${script}})();`).join("\n") |
| | | } |
| | | |
| | | export function emitComponentResources(cfg: GlobalConfiguration, resources: StaticResources, plugins: PluginTypes, emit: EmitCallback) { |
| | |
| | | } |
| | | |
| | | for (const transformer of plugins.transformers) { |
| | | const res = transformer.externalResources |
| | | const res = transformer.externalResources ? transformer.externalResources() : {} |
| | | if (res?.js) { |
| | | staticResources.js = staticResources.js.concat(res.js) |
| | | } |