Skip to content

Commit c12f240

Browse files
committed
fix: make umd build usable in Node
close #1348
1 parent d81dc69 commit c12f240

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,12 @@ module.exports = (api, { entry, name }, options) => {
8989
// use dynamic publicPath so this can be deployed anywhere
9090
// the actual path will be determined at runtime by checking
9191
// document.currentScript.src.
92-
publicPath: ''
92+
publicPath: '',
93+
// preserve UDM header from webpack 3 until webpack provides either
94+
// libraryTarget: 'esm' or target: 'universal'
95+
// https://github.com/webpack/webpack/issues/6522
96+
// https://github.com/webpack/webpack/issues/6525
97+
globalObject: `typeof self !== 'undefined' ? self : this`
9398
})
9499

95100
return rawConfig

0 commit comments

Comments
 (0)