前提是电脑按装的有node+webpack便可往下观看如果没有装的话先安装了再往下观看

1生成package.json文件

webpack+typescrit+antd的配合使用

2,安装webpack ts-loader

webpack+typescrit+antd的配合使用

3安装服务这样的话在浏览器直接输入localhost:8080能够跑起来

webpack+typescrit+antd的配合使用

4在根目录下新建webpack.config.js

webpack+typescrit+antd的配合使用

5,安装typescript @typeps/react @typesc/react-dom react react-dom

webpack+typescrit+antd的配合使用

6,生成tsconfig文件

webpack+typescrit+antd的配合使用

7,在tsconfig中开启这些文件

webpack+typescrit+antd的配合使用

8,在根目录下创建文件夹和文件src/components/App.tsx

webpack+typescrit+antd的配合使用

9,src/index.tsx如下

webpack+typescrit+antd的配合使用

10项目根目录下,index.html

webpack+typescrit+antd的配合使用

10先运行npm run build 然后再运行npm run start结果如下

webpack+typescrit+antd的配合使用

github:dezhizhang/typescript

相关文章:

  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2022-01-26
  • 2022-12-23
  • 2021-12-05
  • 2021-12-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2021-06-01
相关资源
相似解决方案