Code Monkey home page Code Monkey logo

Comments (12)

evan-lc avatar evan-lc commented on April 30, 2024 2

https://github.com/eggjs/egg-boilerplate-ts/blob/master/boilerplate/_package.json 需要使用 ts 的脚手架,配置加上

  "egg": {
    "typescript": true
  }

试了下这个模版,把typing删了再npm run dev并不会重新生成类型声明文件

"egg": { "declarations": true, "typescript": true },

一样的,6.x的egg-bin的我试了还是不行

from egg-bin.

fengmk2 avatar fengmk2 commented on April 30, 2024

给一个可以复现的 repo?

from egg-bin.

evan-lc avatar evan-lc commented on April 30, 2024

@fengmk2 https://stackblitz.com/edit/stackblitz-starters-qkb6hw?description=&file=package.json&title=Egg.js%20Starter
egg-bin的版本是^6,package.json配置了egg.declarations,运行egg-bin没有typings文件,降级egg-bin到4或5是可以的
代码里搜了下egg-ts-helper,应该是重构的时候漏掉了

from egg-bin.

fengmk2 avatar fengmk2 commented on April 30, 2024

https://github.com/eggjs/egg-bin/blob/master/scripts/postinstall.js#L40 在 npm install 阶段没有执行 postinstall 吗?

from egg-bin.

evan-lc avatar evan-lc commented on April 30, 2024

https://github.com/eggjs/egg-bin/blob/master/scripts/postinstall.js#L40 在 npm install 阶段没有执行 postinstall 吗?

我不是很理解,是说在postinstall执行ets么,难道更新typings靠重新npm install吗,这不太合理吧,之前都是egg-bin dev的时候执行ets

from egg-bin.

evan-lc avatar evan-lc commented on April 30, 2024

在packag.json加上如下配置可以了
"egg": { "require": "./node_modules/egg-ts-helper/register.js" },
@fengmk2 这属于breaking change了吧

from egg-bin.

fengmk2 avatar fengmk2 commented on April 30, 2024

先记个 bug

from egg-bin.

fengmk2 avatar fengmk2 commented on April 30, 2024

https://github.com/eggjs/egg-boilerplate-ts/blob/master/boilerplate/_package.json 需要使用 ts 的脚手架,配置加上

  "egg": {
    "typescript": true
  }

from egg-bin.

52atlidong avatar 52atlidong commented on April 30, 2024

https://github.com/eggjs/egg-bin/blob/master/scripts/postinstall.js#L40 在 npm install 阶段没有执行 postinstall 吗?

我不是很理解,是说在postinstall执行ets么,难道更新typings靠重新npm install吗,这不太合理吧,之前都是egg-bin dev的时候执行ets
我也不理解

from egg-bin.

evan-lc avatar evan-lc commented on April 30, 2024

https://github.com/eggjs/egg-boilerplate-ts/blob/master/boilerplate/_package.json 需要使用 ts 的脚手架,配置加上

  "egg": {
    "typescript": true
  }

试了下这个模版,把typing删了再npm run dev并不会重新生成类型声明文件

from egg-bin.

malingxin avatar malingxin commented on April 30, 2024

https://github.com/eggjs/egg-boilerplate-ts/blob/master/boilerplate/_package.json 需要使用 ts 的脚手架,配置加上

  "egg": {
    "typescript": true
  }

试了下这个模版,把typing删了再npm run dev并不会重新生成类型声明文件

"egg": { "declarations": true, "typescript": true },

from egg-bin.

trylovetom avatar trylovetom commented on April 30, 2024

https://github.com/eggjs/egg-boilerplate-ts/blob/master/boilerplate/_package.json 需要使用 ts 的脚手架,配置加上

  "egg": {
    "typescript": true
  }

试了下这个模版,把typing删了再npm run dev并不会重新生成类型声明文件

"egg": { "declarations": true, "typescript": true },

一样的,6.x的egg-bin的我试了还是不行

same problem here.

from egg-bin.

Related Issues (15)

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.