Skip to content

Commit 9874a59

Browse files
committed
fix vuejs#251, Update source-map package
1 parent e28b7ab commit 9874a59

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,9 @@ export default function VuePlugin(opts: VuePluginOptions = {}): Plugin {
285285
export default script
286286
// For security concerns, we use only base name in production mode. See https://github.com/vuejs/rollup-plugin-vue/issues/258
287287
script.__file = ${isProduction ? JSON.stringify(path.basename(filename)) : JSON.stringify(filename)}
288-
`,
289-
map: { mappings: '' },
288+
`
290289
}
291-
: { code: '', map: { mappings: '' } }
290+
: { code: '' }
292291

293292
if (shouldExtractCss) {
294293
input.styles = input.styles
@@ -305,7 +304,7 @@ export default function VuePlugin(opts: VuePluginOptions = {}): Plugin {
305304
)}'`
306305

307306
if (style.module || descriptor.styles[index].scoped) {
308-
return { ...style, code: '', map: { mappings: '' } }
307+
return { ...style, code: '', map: undefined }
309308
}
310309
})
311310
.filter(Boolean)
@@ -331,6 +330,8 @@ export default function VuePlugin(opts: VuePluginOptions = {}): Plugin {
331330

332331
dT(`id: ${filename}\ncode:\n${result.code}\n\nmap:\n${JSON.stringify(result.map, null, 2)}\n`)
333332

333+
result.map = result.map || { mappings: '' }
334+
334335
return result
335336
}
336337
},

0 commit comments

Comments
 (0)