Unable to use requireJS and Node's Require in the same TypeScript project

前端 未结 2 963
庸人自扰
庸人自扰 2021-01-16 06:03

I have a typescript project targeted at both Node and the browser. I\'m using Node\'s require() in some scripts and requireJS\'s require() in othe

2条回答
  •  深忆病人
    2021-01-16 06:37

    Is there a way to use both of these .d.ts files in the same project

    I highly recommend going with commonjs everywhere. That is what the React community has spearheaded and it's a much simpler workflow. Just use CommonJS + webpack (to get lazy require.ensure from here).

提交回复
热议问题