vuejs / component-compiler-utils

Lower level utilities for compiling Vue single file components
319 stars 75 forks source link

Allow for different transpilers than vue-template-es2015-compiler #65

Open thisredone opened 4 years ago

thisredone commented 4 years ago

Specifying a different transpiler than the current vue-template-es2015-compiler would add the ability for code inside the templates to be processed the same (or a similar) way to the code from <script>.

For example there are outstanding proposals to the ecmascript that currently can be used through babel plugins[1] but they won't work inside the template expressions since they don't follow the same compilation path.

[1] https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining

NikhilVerma commented 2 years ago

Here is a solution if you are using a bundler which supports resolutions in package.json

{
  "resolutions": {
    "vue-template-es2015-compiler": "npm:vue-template-babel-compiler@1.1.3"
  }
}
hejun200613224 commented 5 months ago

Here is a solution if you are using a bundler which supports resolutions in package.json

{
  "resolutions": {
    "vue-template-es2015-compiler": "npm:vue-template-babel-compiler@1.1.3"
  }
}

VERY NICE!