Skip to content

Commit

Permalink
fix(plugin-vue): don't inline ts scripts during build (#7909)
Browse files Browse the repository at this point in the history
  • Loading branch information
jods4 committed May 10, 2022
1 parent 6ccf9aa commit ba6cae9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/plugin-vue/src/main.ts
Expand Up @@ -272,7 +272,10 @@ async function genScriptCode(
if (script) {
// If the script is js/ts and has no external src, it can be directly placed
// in the main module.
if ((!script.lang || script.lang === 'ts') && !script.src) {
if (
(!script.lang || (script.lang === 'ts' && options.devServer)) &&
!script.src
) {
scriptCode = options.compiler.rewriteDefault(
script.content,
'_sfc_main',
Expand Down

0 comments on commit ba6cae9

Please sign in to comment.