Merge pull request #339 from sveltejs/gh-337-deconflict-helpers-with-shared-false

deconflict helpers when not using shared helpers
pull/340/merge
Rich Harris 8 years ago committed by GitHub
commit cf4842778b

@ -418,11 +418,13 @@ export default function dom ( parsed, source, options, names ) {
`import { ${names.join( ', ' )} } from ${JSON.stringify( sharedPath )}`
);
} else {
builders.main.addBlock( `var ${generator.aliases.dispatchObservers} = ${shared.dispatchObservers.toString()}` );
Object.keys( generator.uses ).forEach( key => {
const fn = shared[ key ]; // eslint-disable-line import/namespace
builders.main.addBlock( fn.toString() );
if ( key !== generator.aliases[ key ] ) {
builders.main.addBlock( `var ${generator.aliases[ key ]} = ${fn.toString()}}` );
} else {
builders.main.addBlock( fn.toString() );
}
});
}

Loading…
Cancel
Save