fix(web-component): fix multiple wc-async bundles on the same page

close #1150
This commit is contained in:
Evan You
2018-07-20 11:36:18 -04:00
parent 967f99abc0
commit 10aa99641b
@@ -109,6 +109,9 @@ module.exports = (api, { target, entry, name }) => {
}
Object.assign(rawConfig.output, {
// to ensure that multiple copies of async wc bundles can co-exist
// on the same page.
jsonpFunction: libName.replace(/-\w/g, c => c.charAt(1).toUpperCase()) + '_jsonp',
filename: `${entryName}.js`,
chunkFilename: `${libName}.[name]${minify ? `.min` : ``}.js`,
// use dynamic publicPath so this can be deployed anywhere