Skip to content

Commit 77310fc

Browse files
authored
fix(plugin-vue): don't inline ts scripts during build (#7909)
1 parent df8b20f commit 77310fc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/plugin-vue/src/main.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,10 @@ async function genScriptCode(
272272
if (script) {
273273
// If the script is js/ts and has no external src, it can be directly placed
274274
// in the main module.
275-
if ((!script.lang || script.lang === 'ts') && !script.src) {
275+
if (
276+
(!script.lang || (script.lang === 'ts' && options.devServer)) &&
277+
!script.src
278+
) {
276279
scriptCode = options.compiler.rewriteDefault(
277280
script.content,
278281
'_sfc_main',

0 commit comments

Comments
 (0)