Skip to content

Commit

Permalink
fix(plugin-vue): don't inline ts scripts during build
Browse files Browse the repository at this point in the history
  • Loading branch information
jods4 committed Apr 26, 2022
1 parent 3edd1af commit 15c773a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/plugin-vue/src/main.ts
Expand Up @@ -268,7 +268,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 15c773a

Please sign in to comment.