Skip to content

Commit 10aa996

Browse files
committed
fix(web-component): fix multiple wc-async bundles on the same page
close vuejs#1150
1 parent 967f99a commit 10aa996

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/@vue/cli-service/lib/commands/build/resolveWcConfig.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ module.exports = (api, { target, entry, name }) => {
109109
}
110110

111111
Object.assign(rawConfig.output, {
112+
// to ensure that multiple copies of async wc bundles can co-exist
113+
// on the same page.
114+
jsonpFunction: libName.replace(/-\w/g, c => c.charAt(1).toUpperCase()) + '_jsonp',
112115
filename: `${entryName}.js`,
113116
chunkFilename: `${libName}.[name]${minify ? `.min` : ``}.js`,
114117
// use dynamic publicPath so this can be deployed anywhere

0 commit comments

Comments
 (0)