We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1cd0590 commit cedbae9Copy full SHA for cedbae9
packages/plugin-vue-jsx/index.js
@@ -10,6 +10,7 @@ const hash = require('hash-sum')
10
*/
11
module.exports = function vueJsxPlugin(options = {}) {
12
let needHmr = false
13
+ let needSourceMap = true
14
15
return {
16
name: 'vue-jsx',
@@ -31,6 +32,7 @@ module.exports = function vueJsxPlugin(options = {}) {
31
32
33
configResolved(config) {
34
needHmr = config.command === 'serve' && !config.isProduction
35
+ needSourceMap = config.command === 'serve' || !!config.build.sourcemap
36
},
37
38
transform(code, id) {
@@ -47,7 +49,7 @@ module.exports = function vueJsxPlugin(options = {}) {
47
49
const result = babel.transformSync(code, {
48
50
ast: true,
51
plugins,
- sourceMaps: true,
52
+ sourceMaps: needSourceMap,
53
sourceFileName: id
54
})
55
0 commit comments