6.0.0-beta10
https://github.com/iassasin/vue3-rollup-ts-bug
Clone example repository and npm run build.
working bundle
[!] (plugin typescript) Error: Could not load .../MainView.vue?vue&type=script&lang.ts (imported by MainView.vue): Debug Failure. False expression: Expected fileName to be present in command line
What I did wrong? Looks like rollup-plugin-vue bug.
Ensure that the rollup-plugin-vue plugin is run before @rollup/plugin-typescript.
@Smashman, if use this order of plugins, then error changes:
plugins: [
alias({
resolve: [ '.js', '.ts' ],
entries: [
{ find: 'vue', replacement: 'node_modules/vue/dist/vue.runtime.esm-browser.js' }
]
}),
resolve(),
Vue({ preprocessStyles: true }),
typescript(),
css({ output: 'dist/app.css' }),
],
Error:
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
at error (.../vue3-rollup-bug/node_modules/rollup/dist/shared/rollup.js:5215:30)
Looks like typescript doesn't recognized at all.
Btw, see issue in typescript plugin (https://github.com/rollup/plugins/issues/608), maybe this issue doesn't related to rollup-plugin-vue, because with rollup-plugin-typescript2 config from my reproduction works great.
@iassasin I had the same issue, switching from @rollup/plugin-typescript to rollup-plugin-typescript2 fixed it.
@kris-ellery, yes, I use this workaround too, but it's strange if it shouldn't work with official ts plugin.
it's strange if it shouldn't work with official ts plugin.
Agree with that, I waste 15 minutes on the official plugin before finding out the example is using rollup-plugin-typescript2
I think its a bug in the "official plugin" (see https://github.com/rollup/plugins/issues/608).
Most helpful comment
@kris-ellery, yes, I use this workaround too, but it's strange if it shouldn't work with official ts plugin.