Code Monkey home page Code Monkey logo

Comments (7)

csr632 avatar csr632 commented on June 4, 2024

You should not use @rollup/plugin-typescript with vite. vite can build ts already (it use esbuild to do that)

from vite-plugin-react-pages.

yunsii avatar yunsii commented on June 4, 2024

I use @rollup/plugin-typescript to generate d.ts files, after vite build there is no declaretion files 😂 also it resolve ts paths map.

from vite-plugin-react-pages.

yunsii avatar yunsii commented on June 4, 2024

Use vite-tsconfig-paths and vite-plugin-dts as a workaround, do not care framework runtime code under the hood。

from vite-plugin-react-pages.

csr632 avatar csr632 commented on June 4, 2024

I use @rollup/plugin-typescript to generate d.ts files

I found discussions about generating d.ts files using vite: vitejs/vite#3461

Personally I don't recommand generating d.ts files using vite. I prefer using ts compiler to do that: tsc --emitDeclarationOnly. It is more reliable because it is officially supported by typescript. Comment from Evan

from vite-plugin-react-pages.

csr632 avatar csr632 commented on June 4, 2024

By the way, @rollup/[email protected] just offer a new option to allow "emit-dts-only" usecase! rollup/plugins@a21db7d

Here is an example that use vite to build the demo library: https://github.com/vitejs/vite-plugin-react-pages/pull/81/files

Notice that vite-pages has nothing to do with the library-building process. That's why we need vite.config.ts for library-building and docs/vite.config.ts for doc-building.

from vite-plugin-react-pages.

yunsii avatar yunsii commented on June 4, 2024

I found discussions about generating d.ts files using vite: vitejs/vite#3461

Personally I don't recommand generating d.ts files using vite. I prefer using ts compiler to do that: tsc --emitDeclarationOnly. It is more reliable because it is officially supported by typescript. Comment from Evan

I think all in vite.config is more elegant 😂

from vite-plugin-react-pages.

yunsii avatar yunsii commented on June 4, 2024

By the way, @rollup/[email protected] just offer a new option to allow "emit-dts-only" usecase! rollup/plugins@a21db7d

Here is an example that use vite to build the demo library: #81 (files)

Notice that vite-pages has nothing to do with the library-building process. That's why we need vite.config.ts for library-building and docs/vite.config.ts for doc-building.

emitDeclarationOnly is awesome, but now I use the workaround solution, I will go back to use @rollup/plugin-typescript after encounter vital qustion.

from vite-plugin-react-pages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.