Closed mesqueeb closed 4 years ago
compiling a vue SFC with lang="ts"
worked for me with this setup:
import VuePlugin from 'rollup-plugin-vue'
import typescript from 'rollup-plugin-typescript2'
export default {
plugins: [
typescript({
typescript: require('typescript'),
objectHashIgnoreUnknownHack: true,
}),
VuePlugin(/* VuePluginOptions */),
],
input: 'src/components/HelloWorld.vue',
output: [
{ file: 'dist/HelloWorld.cjs.js', format: 'cjs' },
{ file: 'dist/HelloWorld.esm.js', format: 'esm' },
],
}
without that objectHashIgnoreUnknownHack
it doesn't.
I'm not sure if this is the best way to create a module out of a Vue SFC with lang="ts"
.
If anyone has any advice, please let me know.
The requirement for objectHashIgnoreUnknownHack
is fixed in #324.
@mesqueeb Your usage example seems correct.
What problem does this feature solve?
Currently it has a setup example for Vue files with JavaScript script tags.
I think it would be greatly beneficial for a lot of devs to add a setup example for dev who use Vue files with:
for TypeScript (but without the class syntax)
What does the proposed API look like?
Setup example for TypeScript