Skip to content

Commit 7646adc

Browse files
ackzellAkryum
andauthored
fix: Default lang value for script blocks (#424)
Co-authored-by: Guillaume Chau <[email protected]>
1 parent ae31492 commit 7646adc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/vue-component/plugin/tag-handler.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ VueComponentTagHandler = class VueComponentTagHandler {
7272

7373
maps.push(generateSourceMap(inputFilePath, source, script, getLineNumber(source, sfcBlock.start)))
7474

75+
// treating the <script> default as if it were `lang="js"`
76+
// since some tools (like meteor-vuetify-loader) require to have the attribute present to work
77+
if (sfcBlock.type === 'script' && !sfcBlock.lang) {
78+
sfcBlock.lang = 'js'
79+
}
80+
7581
// Lang
7682
if (sfcBlock.lang !== undefined) {
7783
let lang = sfcBlock.lang

0 commit comments

Comments
 (0)