Skip to content

Commit a007d41

Browse files
committed
提交demo
1 parent b135427 commit a007d41

File tree

120 files changed

+10739
-3068
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+10739
-3068
lines changed

Diff for: .DS_Store

2 KB
Binary file not shown.

Diff for: README.md

100644100755
+8-44
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,34 @@
1-
# Getting Started with Create React App
2-
31
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
42

53
## Available Scripts
64

75
In the project directory, you can run:
86

9-
### `yarn start`
7+
### `npm start`
108

11-
Runs the app in the development mode.\
9+
Runs the app in the development mode.<br>
1210
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
1311

14-
The page will reload if you make edits.\
12+
The page will reload if you make edits.<br>
1513
You will also see any lint errors in the console.
1614

17-
### `yarn test`
15+
### `npm test`
1816

19-
Launches the test runner in the interactive watch mode.\
17+
Launches the test runner in the interactive watch mode.<br>
2018
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
2119

22-
### `yarn build`
20+
### `npm run build`
2321

24-
Builds the app for production to the `build` folder.\
22+
Builds the app for production to the `build` folder.<br>
2523
It correctly bundles React in production mode and optimizes the build for the best performance.
2624

27-
The build is minified and the filenames include the hashes.\
25+
The build is minified and the filenames include the hashes.<br>
2826
Your app is ready to be deployed!
2927

3028
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
3129

32-
### `yarn eject`
33-
34-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35-
36-
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37-
38-
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39-
40-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41-
4230
## Learn More
4331

4432
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
4533

4634
To learn React, check out the [React documentation](https://reactjs.org/).
47-
48-
### Code Splitting
49-
50-
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51-
52-
### Analyzing the Bundle Size
53-
54-
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55-
56-
### Making a Progressive Web App
57-
58-
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59-
60-
### Advanced Configuration
61-
62-
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63-
64-
### Deployment
65-
66-
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67-
68-
### `yarn build` fails to minify
69-
70-
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)

Diff for: config-overrides.js

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
const {
2+
override,
3+
fixBabelImports,
4+
addWebpackAlias,
5+
addDecoratorsLegacy,
6+
addWebpackPlugin,
7+
addLessLoader,
8+
} = require('customize-cra');
9+
const TerserPlugin = require('terser-webpack-plugin');
10+
const webpack = require('webpack');
11+
const { theme } = require('./package.json');
12+
const path = require('path');
13+
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
14+
15+
// 打包配置
16+
const addCustomize = () => config => {
17+
// config.output.path = path.resolve(__dirname, 'tx');
18+
// console.log(config, 'config======]');
19+
return config;
20+
};
21+
22+
const addEnvironmentVariables = () => {
23+
const REACT_APP = /^REACT_APP_/i;
24+
const { argv } = process;
25+
argv
26+
.filter(value => REACT_APP.test(value))
27+
.forEach(value => {
28+
const values = value.split('=');
29+
process.env[values[0]] = values[1];
30+
});
31+
return addWebpackPlugin(
32+
new webpack.ProvidePlugin({
33+
'process.env': JSON.stringify(process.env),
34+
})
35+
);
36+
};
37+
const addTerserPlugin = () => config => {
38+
config.optimization.minimizer[0] =
39+
// This is only used in production mode
40+
new TerserPlugin({
41+
terserOptions: {
42+
parse: {
43+
// we want terser to parse ecma 8 code. However, we don't want it
44+
// to apply any minfication steps that turns valid ecma 5 code
45+
// into invalid ecma 5 code. This is why the 'compress' and 'output'
46+
// sections only apply transformations that are ecma 5 safe
47+
// https://github.com/facebook/create-react-app/pull/4234
48+
ecma: 8,
49+
},
50+
compress: {
51+
ecma: 5,
52+
warnings: false,
53+
// Disabled because of an issue with Uglify breaking seemingly valid code:
54+
// https://github.com/facebook/create-react-app/issues/2376
55+
// Pending further investigation:
56+
// https://github.com/mishoo/UglifyJS2/issues/2011
57+
comparisons: false,
58+
// Disabled because of an issue with Terser breaking valid code:
59+
// https://github.com/facebook/create-react-app/issues/5250
60+
// Pending futher investigation:
61+
// https://github.com/terser-js/terser/issues/120
62+
inline: 2,
63+
},
64+
mangle: {
65+
safari10: true,
66+
},
67+
output: {
68+
ecma: 5,
69+
comments: false,
70+
// Turned on because emoji and regex is not minified properly using default
71+
// https://github.com/facebook/create-react-app/issues/2488
72+
ascii_only: true,
73+
},
74+
},
75+
// Use multi-process parallel running to improve the build speed
76+
// Default number of concurrent runs: os.cpus().length - 1
77+
parallel: true,
78+
// Enable file caching
79+
cache: true,
80+
sourceMap: shouldUseSourceMap,
81+
});
82+
return config;
83+
};
84+
85+
module.exports = {
86+
webpack: override(
87+
fixBabelImports('antd', {
88+
libraryDirectory: 'es',
89+
style: true,
90+
}),
91+
addWebpackAlias({
92+
//路径别名
93+
'react-native': 'react-native-web',
94+
'@': path.resolve(__dirname, 'src'),
95+
'@components': path.resolve(__dirname, 'src/components'),
96+
}),
97+
addDecoratorsLegacy(),
98+
addLessLoader({
99+
// lessOptions: {
100+
// 如果使用less-loader@5,请移除 lessOptions 这一级直接配置选项。
101+
javascriptEnabled: true,
102+
modifyVars: theme,
103+
// },
104+
}),
105+
addTerserPlugin(),
106+
addEnvironmentVariables(),
107+
addCustomize()
108+
),
109+
};

Diff for: package.json

100644100755
+62-30
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,73 @@
11
{
2-
"name": "scale-view",
3-
"version": "0.1.0",
2+
"name": "react-starter-kit",
3+
"version": "1.1.2",
44
"private": true,
5+
"description": "react",
6+
"homepage": ".",
7+
"scripts": {
8+
"analyze": "source-map-explorer build/static/js/*.js",
9+
"start": "react-app-rewired start",
10+
"build": "react-app-rewired build",
11+
"test": "react-app-rewired test",
12+
"storybook": "start-storybook -p 9009 -s public",
13+
"build-storybook": "build-storybook -s public"
14+
},
515
"dependencies": {
6-
"@testing-library/jest-dom": "^5.11.4",
7-
"@testing-library/react": "^11.1.0",
8-
"@testing-library/user-event": "^12.1.10",
916
"prop-types": "^15.7.2",
10-
"react": "^17.0.1",
11-
"react-dom": "^17.0.1",
17+
"react": "^16.13.1",
18+
"react-dom": "^16.13.1",
1219
"react-loadable": "^5.5.0",
13-
"react-router-dom": "^5.2.0",
14-
"react-scripts": "4.0.2",
15-
"web-vitals": "^1.0.1"
20+
"react-router-dom": "^5.1.2",
21+
"react-scripts": "3.4.1"
1622
},
17-
"scripts": {
18-
"start": "react-scripts start",
19-
"build": "react-scripts build",
20-
"test": "react-scripts test",
21-
"eject": "react-scripts eject"
23+
"devDependencies": {
24+
"@babel/core": "^7.7.7",
25+
"@babel/plugin-proposal-decorators": "^7.7.4",
26+
"@storybook/addon-actions": "^5.2.8",
27+
"@storybook/addon-docs": "^5.3.13",
28+
"@storybook/addon-links": "^5.2.6",
29+
"@storybook/addons": "^5.3.19",
30+
"@storybook/preset-create-react-app": "^3.0.0",
31+
"@storybook/react": "^5.3.19",
32+
"@types/react": "^16.9.17",
33+
"@types/react-dom": "^16.9.4",
34+
"@types/react-loadable": "^5.5.3",
35+
"@types/react-router-dom": "^5.1.3",
36+
"@types/react-transition-group": "^4.2.3",
37+
"@typescript-eslint/eslint-plugin": "^2.13.0",
38+
"@typescript-eslint/parser": "^2.13.0",
39+
"babel-loader": "8.1.0",
40+
"babel-plugin-import": "^1.13.0",
41+
"css-loader": "^3.4.0",
42+
"customize-cra": "^1.0.0-alpha.0",
43+
"eslint": "^6.8.0",
44+
"eslint-config-prettier": "^6.7.0",
45+
"eslint-config-react-app": "^5.1.0",
46+
"eslint-loader": "^3.0.3",
47+
"eslint-plugin-flowtype": "^4.5.2",
48+
"eslint-plugin-import": "^2.19.1",
49+
"eslint-plugin-jsx-a11y": "^6.2.3",
50+
"eslint-plugin-prettier": "^3.1.2",
51+
"eslint-plugin-react": "^7.17.0",
52+
"eslint-plugin-react-hooks": "^2.3.0",
53+
"less": "^3.10.3",
54+
"less-loader": "^5.0.0",
55+
"prettier": "^1.19.1",
56+
"react-app-rewired": "^2.1.5",
57+
"react-is": "^16.12.0",
58+
"terser-webpack-plugin": "1.2.2",
59+
"typescript": "^3.7.4"
2260
},
2361
"eslintConfig": {
24-
"extends": [
25-
"react-app",
26-
"react-app/jest"
27-
]
62+
"extends": "react-app"
2863
},
29-
"browserslist": {
30-
"production": [
31-
">0.2%",
32-
"not dead",
33-
"not op_mini all"
34-
],
35-
"development": [
36-
"last 1 chrome version",
37-
"last 1 firefox version",
38-
"last 1 safari version"
39-
]
64+
"browserslist": [
65+
">0.2%",
66+
"not dead",
67+
"not ie <= 11",
68+
"not op_mini all"
69+
],
70+
"theme": {
71+
"primary-color": "#1DA57A"
4072
}
4173
}

Diff for: public/favicon.ico

100644100755
File mode changed.

Diff for: public/fonts/ionicons/ionicons.ttf

184 KB
Binary file not shown.

Diff for: public/index.html

100644100755
+15-11
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1" />
5+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<!-- <meta name="viewport" content="width=device-width, initial-scale=1" /> -->
77
<meta name="theme-color" content="#000000" />
8-
<meta
9-
name="description"
10-
content="Web site created using create-react-app"
11-
/>
12-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
8+
<!-- <link rel="stylesheet" type="text/css" href="%PUBLIC_URL%/ionicons.min.css" />
9+
<link rel="stylesheet" type="text/css" href="%PUBLIC_URL%/titilliumweb.css" /> -->
1310
<!--
14-
manifest.json provides metadata used when your web app is installed on a
15-
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
11+
manifest.json provides metadata used when your web app is added to the
12+
homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/
1613
-->
1714
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
1815
<!--
@@ -24,10 +21,17 @@
2421
work correctly both with client-side routing and a non-root public URL.
2522
Learn how to configure a non-root public URL by running `npm run build`.
2623
-->
27-
<title>React App</title>
24+
<!--高德地图JS API-->
25+
<script
26+
src="https://webapi.amap.com/maps?v=1.4.15&key=3bcf5ffad0dfb938584c040db30f7fa9"
27+
type="text/javascript"
28+
></script>
29+
<title>React App Stater</title>
2830
</head>
2931
<body>
30-
<noscript>You need to enable JavaScript to run this app.</noscript>
32+
<noscript>
33+
You need to enable JavaScript to run this app.
34+
</noscript>
3135
<div id="root"></div>
3236
<!--
3337
This HTML file is a template.

Diff for: public/ionicons.min.css

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: public/logo192.png

-5.22 KB
Binary file not shown.

Diff for: public/logo512.png

-9.44 KB
Binary file not shown.

Diff for: public/manifest.json

100644100755
+1-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
{
2-
"short_name": "React App",
2+
"short_name": "React Starter kit",
33
"name": "Create React App Sample",
44
"icons": [
55
{
66
"src": "favicon.ico",
77
"sizes": "64x64 32x32 24x24 16x16",
88
"type": "image/x-icon"
9-
},
10-
{
11-
"src": "logo192.png",
12-
"type": "image/png",
13-
"sizes": "192x192"
14-
},
15-
{
16-
"src": "logo512.png",
17-
"type": "image/png",
18-
"sizes": "512x512"
199
}
2010
],
2111
"start_url": ".",

Diff for: public/robots.txt

-3
This file was deleted.

0 commit comments

Comments
 (0)