]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: move style vars deprecation warning to a parse error
authorEvan You <yyx990803@gmail.com>
Sun, 22 Nov 2020 04:53:32 +0000 (23:53 -0500)
committerEvan You <yyx990803@gmail.com>
Sun, 22 Nov 2020 04:53:32 +0000 (23:53 -0500)
packages/compiler-sfc/src/parse.ts

index 416622013b60e4d2ca50776702c8e93dc670980a..1df52721ac7b9812889ae1643a3157008693b5f9 100644 (file)
@@ -11,7 +11,7 @@ import { RawSourceMap, SourceMapGenerator } from 'source-map'
 import { TemplateCompiler } from './compileTemplate'
 import { Statement } from '@babel/types'
 import { parseCssVars } from './cssVars'
-import { warnExperimental, warnOnce } from './warn'
+import { warnExperimental } from './warn'
 
 export interface SFCParseOptions {
   filename?: string
@@ -168,9 +168,11 @@ export function parse(
       case 'style':
         const style = createBlock(node, source, pad) as SFCStyleBlock
         if (style.attrs.vars) {
-          warnOnce(
-            `<style vars> has been replaced by a new proposal: ` +
-              `https://github.com/vuejs/rfcs/pull/231`
+          errors.push(
+            new SyntaxError(
+              `<style vars> has been replaced by a new proposal: ` +
+                `https://github.com/vuejs/rfcs/pull/231`
+            )
           )
         }
         descriptor.styles.push(style)