Is it possible to write webpack config in typescript?

前端 未结 5 1324
礼貌的吻别
礼貌的吻别 2020-12-25 09:40

I saw, when searching, that there are typings for webpack. So it seems I can write webpack.config.js in typescript? But how can I do that?

5条回答
  •  青春惊慌失措
    2020-12-25 10:41

    I can't find any clue in the webpack sourcecode, that you can use a webpack.config.ts file directly as configuration for your project.

    Of course, because TypeScript is just a superset for Javascript, you can always use TypeScript to write your webpack.config.ts and convert it to a valid Javascript webpack.config.js file.

提交回复
热议问题