FranckFreiburger / vue3-sfc-loader

Single File Component loader for Vue2 and Vue3. Load .vue files directly from your HTML. No node.js environment, no build step.
MIT License
1.03k stars 116 forks source link

Add babel step for TS scripts #156

Closed DarioDaF closed 5 months ago

DarioDaF commented 1 year ago

Is your feature request related to a problem? Please describe. Using vue3-sfc-loader to run code without build system having lang="ts" SFCs will process the code as javascript by default.

Describe the solution you'd like I'd expect in the options (present but not documented) to have something like:

options = {
  // ....
  additionalBabelPlugins: {
    '@babel/plugin-syntax-typescript': TSPlugin
  },
  additionalBabelParserPlugins: [ '@babel/plugin-syntax-typescript' ]
}

The problem is what TSPlugin should be and if it is possible to load it as esm via a CDN

Describe alternatives you've considered N/A

Additional context Noticable when using type X = { in the script TS in SFC