Code Monkey home page Code Monkey logo

Comments (8)

agileago avatar agileago commented on August 24, 2024

找到原因了, microsoft/TypeScript#18008

from download-kernel.

agileago avatar agileago commented on August 24, 2024

transpile模式下确实会和命令行不一样

from download-kernel.

CarterLi avatar CarterLi commented on August 24, 2024

vite-plugin-ts这插件居然真有人用😂

from download-kernel.

agileago avatar agileago commented on August 24, 2024

咋了,我需要用到装饰器做依赖注入,搜了一下就用了

from download-kernel.

CarterLi avatar CarterLi commented on August 24, 2024

挺好啊

至于类型的问题,transpileModule只能看到当前文件的内容,获得的信息有限。而tsc针对的是整个项目,获得的信息更全面。我估计是这个原因导致的差异。

既然问题解决了,issue我关了

from download-kernel.

agileago avatar agileago commented on August 24, 2024

@CarterLi 是否也可以像 ts-loader 那样提供一个 https://github.com/TypeStrong/ts-loader#transpileonly transpileonly 的选项使这个问题缓解

from download-kernel.

CarterLi avatar CarterLi commented on August 24, 2024

我研究了一下,transpileonly不是一个简单的开关,ts-loader对于是否开启transpileonly使用了完全不同的逻辑

https://github.com/TypeStrong/ts-loader/blob/55d2a85850674d69af1be603c1218384465fa457/src/index.ts#L77

然后这逻辑我看不懂。。。你有兴趣研究的话可以开PR @agileago

from download-kernel.

agileago avatar agileago commented on August 24, 2024

先把项目迁移到 vue-cli 吧, vite后期看看有空再搞

from download-kernel.

Related Issues (1)

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.