用官方Create-react-app搭建支持Typescript和PWA的过程
1、npx create-react-app my-app --typescript (using npm uninstall -g create-react-app to ensure that npx always uses the latest version.) 2、cnpm i customize-cra react-app-rewired --save-dev/-D 3、cnpm i ant-mobile node-sass --save/-S 4、touch config-overrides.js eg: const { override,fixBabelImports, } = require("customize-cra"); module.exports = override( fixBabelImports("import", { libraryName: "antd-mobile", style: "css" }) ) 5、edit package.json "scripts": { +"start": "react-app-rewired start", -"start": "react-scripts start" } 6、npm start FAQ: customize-cra webpack重新配置css中图片路径:https://www