Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

TSX Can not be built with Rollup (Vue 3) #453

Open
snowdream opened this issue Aug 28, 2021 · 1 comment
Open

TSX Can not be built with Rollup (Vue 3) #453

snowdream opened this issue Aug 28, 2021 · 1 comment

Comments

@snowdream
Copy link

Version

5.0.0

Reproduction link

github.com/snowdreamtech/ruim

Steps to reproduce

rollup -c

What is expected?

Build with no error.

What is actually happening?

ruim git:(master) rollup -c       

src/components/helloworld/HelloWorld.tsx → dist/helloworld/helloworld.cjs.js, dist/helloworld/helloworld.esm.js, dist/helloworld/helloworld.js...
(!) Error when using sourcemap for reporting an error: Can't resolve original location of error.
src/components/helloworld/HelloWorld.tsx (13:22)
[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
src/components/helloworld/HelloWorld.tsx (13:22)
11:             count.value++;
12:         };
13:         return () => (<>
                         ^
14:         <h1>{msg}</h1>
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
   at error (/Users/snowdream/.nvm/versions/node/v15.13.0/lib/node_modules/rollup/dist/shared/rollup.js:151:30)
   at Module.error (/Users/snowdream/.nvm/versions/node/v15.13.0/lib/node_modules/rollup/dist/shared/rollup.js:10059:16)
   at Module.tryParse (/Users/snowdream/.nvm/versions/node/v15.13.0/lib/node_modules/rollup/dist/shared/rollup.js:10462:25)
   at Module.setSource (/Users/snowdream/.nvm/versions/node/v15.13.0/lib/node_modules/rollup/dist/shared/rollup.js:10365:24)
   at ModuleLoader.addModuleSource (/Users/snowdream/.nvm/versions/node/v15.13.0/lib/node_modules/rollup/dist/shared/rollup.js:19708:20)
   at async ModuleLoader.fetchModule (/Users/snowdream/.nvm/versions/node/v15.13.0/lib/node_modules/rollup/dist/shared/rollup.js:19761:9)
   at async Promise.all (index 0)

like
@vitejs/plugin-vue
@vitejs/plugin-vue-jsx

should we need a plugin like rollup-plugin-vue-jsx?

@snowdream snowdream changed the title TSX Can not be built with Rollup TSX Can not be built with Rollup (Vue 3) Aug 28, 2021
@hellomrbigshot
Copy link

You don't need build component with this plugin. You only need @vue/babel-plugin-jsx. See this example project

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants