diff --git a/packages/vue-component/package.js b/packages/vue-component/package.js index 178e6ea..0968a16 100644 --- a/packages/vue-component/package.js +++ b/packages/vue-component/package.js @@ -35,7 +35,7 @@ Package.registerBuildPlugin({ 'source-map-merger': '0.2.0', 'generate-source-map': '0.0.5', 'autoprefixer': '9.5.1', - 'vue-template-compiler': '2.6.11', + 'vue-template-compiler': '2.6.12', 'vue-template-es2015-compiler': '1.9.1', 'colors': '1.3.3', 'app-module-path': '2.2.0', diff --git a/packages/vue-component/plugin/tag-handler.js b/packages/vue-component/plugin/tag-handler.js index 3ff9ba1..b27ec8b 100644 --- a/packages/vue-component/plugin/tag-handler.js +++ b/packages/vue-component/plugin/tag-handler.js @@ -57,7 +57,7 @@ VueComponentTagHandler = class VueComponentTagHandler { let inputFilePath = this.inputFile.getPathInPackage() let fullInputFilePath = packageName ? '/packages/' + packageName + '/' + inputFilePath : '/' + inputFilePath let hash = 'data-v-' + Hash(fullInputFilePath) - + let js = '' let styles = [] @@ -72,9 +72,16 @@ VueComponentTagHandler = class VueComponentTagHandler { maps.push(generateSourceMap(inputFilePath, source, script, getLineNumber(source, sfcBlock.start))) - // Lang - if (sfcBlock.lang !== undefined) { - let lang = sfcBlock.lang + // Lang or compiler + + // cpl is a custom compiler defined by another package + // Specially useful when using vscode+vetur, as the dev experience + // with vetur is affected is not optimal when using lang attr + // in script tag + const cpl = sfcBlock.attrs?.cpl + let lang = sfcBlock.lang || cpl + + if (lang !== undefined) { try { let compile = global.vue.lang[lang] if (!compile) {