diff --git a/config/index.js b/config/index.js index dc059b8..ed4a7d1 100644 --- a/config/index.js +++ b/config/index.js @@ -47,6 +47,7 @@ const config = { } }, h5: { + esnextModules: ['taro-ui'], publicPath: '/', staticDirectory: 'static', postcss: { diff --git a/package.json b/package.json index b9ce050..70f593b 100644 --- a/package.json +++ b/package.json @@ -32,42 +32,43 @@ "@babel/runtime": "^7.7.7", "@tarojs/components": "3.6.20", "@tarojs/helper": "3.6.20", - "@tarojs/plugin-platform-weapp": "3.6.20", + "@tarojs/plugin-framework-react": "3.6.20", "@tarojs/plugin-platform-alipay": "3.6.20", - "@tarojs/plugin-platform-tt": "3.6.20", - "@tarojs/plugin-platform-swan": "3.6.20", + "@tarojs/plugin-platform-h5": "3.6.20", "@tarojs/plugin-platform-jd": "3.6.20", "@tarojs/plugin-platform-qq": "3.6.20", - "@tarojs/plugin-platform-h5": "3.6.20", + "@tarojs/plugin-platform-swan": "3.6.20", + "@tarojs/plugin-platform-tt": "3.6.20", + "@tarojs/plugin-platform-weapp": "3.6.20", + "@tarojs/react": "3.6.20", "@tarojs/runtime": "3.6.20", "@tarojs/shared": "3.6.20", "@tarojs/taro": "3.6.20", - "@tarojs/plugin-framework-react": "3.6.20", - "@tarojs/react": "3.6.20", - "react-dom": "^18.0.0", "react": "^18.0.0", - "sr-sdk-h5": "^1.3.1" + "react-dom": "^18.0.0", + "sr-sdk-h5": "^1.3.1", + "taro-ui": "^3.2.0" }, "devDependencies": { "@babel/core": "^7.8.0", + "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5", "@tarojs/cli": "3.6.20", - "@types/webpack-env": "^1.13.6", - "postcss": "^8.4.18", - "@types/react": "^18.0.0", - "webpack": "^5.78.0", "@tarojs/taro-loader": "3.6.20", "@tarojs/webpack5-runner": "3.6.20", + "@types/node": "^18.15.11", + "@types/react": "^18.0.0", + "@types/webpack-env": "^1.13.6", "babel-preset-taro": "3.6.20", + "eslint": "^8.12.0", "eslint-config-taro": "3.6.20", - "eslint": "^8.12.0","eslint": "^8.12.0", - "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5", - "react-refresh": "^0.11.0", - "eslint-plugin-react": "^7.8.2", "eslint-plugin-import": "^2.12.0", + "eslint-plugin-react": "^7.8.2", "eslint-plugin-react-hooks": "^1.6.1", + "postcss": "^8.4.18", + "react-refresh": "^0.11.0", "stylelint": "9.3.0", - "typescript": "^4.1.0", "ts-node": "^10.9.1", - "@types/node": "^18.15.11" + "typescript": "^4.1.0", + "webpack": "^5.78.0" } } diff --git a/src/app.js b/src/app.js index 42bf54c..e44c004 100644 --- a/src/app.js +++ b/src/app.js @@ -2,6 +2,7 @@ import { Component } from 'react' import SDK from 'sr-sdk-h5' import './app.scss' +import 'taro-ui/dist/style/index.scss' // 全局引入一次即可 /** * 有数埋点SDK 默认配置 diff --git a/yarn.lock b/yarn.lock index 6637e2a..f2d361a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3826,7 +3826,7 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -classnames@^2.2.5: +classnames@^2.2.5, classnames@^2.2.6: version "2.3.2" resolved "https://registry.npmmirror.com/classnames/-/classnames-2.3.2.tgz#351d813bf0137fcc6a76a16b88208d2560a0d924" integrity sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw== @@ -4446,6 +4446,11 @@ data-urls@^4.0.0: whatwg-mimetype "^3.0.0" whatwg-url "^12.0.0" +dayjs@^1.7.7: + version "1.11.10" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.10.tgz#68acea85317a6e164457d6d6947564029a6a16a0" + integrity sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ== + debug@2.6.9, debug@^2.2.0, debug@^2.3.3: version "2.6.9" resolved "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -8100,7 +8105,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.npmmirror.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== -"lodash@4.6.1 || ^4.16.1", lodash@^4.17.11, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4: +"lodash@4.6.1 || ^4.16.1", lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4: version "4.17.21" resolved "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -9967,7 +9972,7 @@ promise-polyfill@^7.1.0: resolved "https://registry.npmmirror.com/promise-polyfill/-/promise-polyfill-7.1.2.tgz#ab05301d8c28536301622d69227632269a70ca3b" integrity sha512-FuEc12/eKqqoRYIGBrUptCBRhobL19PS2U31vMNTfyck1FxPyMfgsXyW4Mav85y/ZN1hop3hOwRlUDok23oYfQ== -prop-types@^15.8.1: +prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.npmmirror.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== @@ -10149,6 +10154,21 @@ react-is@^17.0.1: resolved "https://registry.npmmirror.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +react-native-animatable@1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/react-native-animatable/-/react-native-animatable-1.3.3.tgz#a13a4af8258e3bb14d0a9d839917e9bb9274ec8a" + integrity sha512-2ckIxZQAsvWn25Ho+DK3d1mXIgj7tITkrS4pYDvx96WyOttSvzzFeQnM2od0+FUMzILbdHDsDEqZvnz1DYNQ1w== + dependencies: + prop-types "^15.7.2" + +react-native-modal@^13.0.0: + version "13.0.1" + resolved "https://registry.yarnpkg.com/react-native-modal/-/react-native-modal-13.0.1.tgz#691f1e646abb96fa82c1788bf18a16d585da37cd" + integrity sha512-UB+mjmUtf+miaG/sDhOikRfBOv0gJdBU2ZE1HtFWp6UixW9jCk/bhGdHUgmZljbPpp0RaO/6YiMmQSSK3kkMaw== + dependencies: + prop-types "^15.6.2" + react-native-animatable "1.3.3" + react-reconciler@0.27.0: version "0.27.0" resolved "https://registry.npmmirror.com/react-reconciler/-/react-reconciler-0.27.0.tgz#360124fdf2d76447c7491ee5f0e04503ed9acf5b" @@ -11673,6 +11693,17 @@ tar-stream@^1.5.2: to-buffer "^1.1.1" xtend "^4.0.0" +taro-ui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/taro-ui/-/taro-ui-3.2.0.tgz#daa861d91694544ec8d30ee2e4d9e412832cb239" + integrity sha512-C3A2DaWQ7yCgQQEEEVbGQLByc4Op86py/AgIk0HLDUvp5rzLkpPSyMZWY7TvYroyyyy+ARt6BmDcLinT80xUUw== + dependencies: + classnames "^2.2.6" + dayjs "^1.7.7" + lodash "^4.17.10" + prop-types "^15.7.2" + react-native-modal "^13.0.0" + terser-webpack-plugin@^5.1.3, terser-webpack-plugin@^5.3.7: version "5.3.9" resolved "https://registry.npmmirror.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz#832536999c51b46d468067f9e37662a3b96adfe1"