We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vue SFC compilerOptions do not appear to be respected.
compilerOptions
I tried https://github.com/wingsico/vite-babel-plugin. No luck. This seems to only work for js files, not anything in SFCs.
This is definitely something that should work, we have tests for it in core: https://github.com/vuejs/vue-next/blob/master/packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts#L444
Create a minimal project with these two files:
vite.config.ts
import vue from '@vitejs/plugin-vue' import { babel } from '@rollup/plugin-babel' import { UserConfig } from 'vite' export default { plugins: [ babel({ plugins: [ ['@babel/plugin-proposal-pipeline-operator', { proposal: 'fsharp' }], ] }), vue({ template: { compilerOptions: { expressionPlugins: [ ['pipelineOperator', { proposal: 'fsharp' }] ] }, }, script: { babelParserPlugins: [ ['pipelineOperator', { proposal: 'fsharp' }], 'partialApplication' ] } }), ] } as UserConfig
app.vue
<template> {{ bar |> up }} {{ foo }} </template> <script> export default { setup() { const up = x => x.toUpperCase() const foo = 'foo' |> up return { bar: 'ok', up, foo } } } </script>
Should work, but fails on "unexpected token" since it does not understand |>.
|>
vite
vite build
--debug
[rollup-plugin-dynamic-import-variables] Unexpected token (6:23) file: /Users/lachlan/code/dump/reader/src/App.vue:6:23 error during build: SyntaxError: Unexpected token (6:23) at Object.pp$4.raise (/Users/lachlan/code/dump/reader/node_modules/rollup/dist/shared/rollup.js:15589:13)
The text was updated successfully, but these errors were encountered:
0503d42
No branches or pull requests
Describe the bug
Vue SFC
compilerOptions
do not appear to be respected.I tried https://github.com/wingsico/vite-babel-plugin. No luck. This seems to only work for js files, not anything in SFCs.
This is definitely something that should work, we have tests for it in core: https://github.com/vuejs/vue-next/blob/master/packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts#L444
Reproduction
Create a minimal project with these two files:
vite.config.ts
app.vue
Should work, but fails on "unexpected token" since it does not understand
|>
.System Info
vite
version: ^2.0.0-beta.12"Logs (Optional if provided reproduction)
vite
orvite build
with the--debug
flag.The text was updated successfully, but these errors were encountered: