浏览代码

重新初始化web

xielq 4 年之前
父节点
当前提交
a2753de3fe
共有 7 个文件被更改,包括 820 次插入741 次删除
  1. 8 0
      web/.babelrc
  2. 42 51
      web/.gitignore
  3. 1 0
      web/.npmrc
  4. 2 2
      web/index.html
  5. 757 686
      web/package-lock.json
  6. 1 1
      web/package.json
  7. 9 1
      web/src/index.js

+ 8 - 0
web/.babelrc

@@ -0,0 +1,8 @@
+{
+  "presets": [
+    "react",
+    "env",
+    "stage-0"
+  ],
+  "plugins": ["transform-decorators-legacy", "transform-runtime"]
+}

+ 42 - 51
web/.gitignore

@@ -1,13 +1,11 @@
+# Created by .ignore support plugin (hsz.mobi)
+### Node template
 # Logs
 logs
 *.log
 npm-debug.log*
 yarn-debug.log*
 yarn-error.log*
-lerna-debug.log*
-
-# Diagnostic reports (https://nodejs.org/api/report.html)
-report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
 
 # Runtime data
 pids
@@ -20,12 +18,11 @@ lib-cov
 
 # Coverage directory used by tools like istanbul
 coverage
-*.lcov
 
 # nyc test coverage
 .nyc_output
 
-# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
 .grunt
 
 # Bower dependency directory (https://bower.io/)
@@ -34,18 +31,15 @@ bower_components
 # node-waf configuration
 .lock-wscript
 
-# Compiled binary addons (https://nodejs.org/api/addons.html)
+# Compiled binary addons (http://nodejs.org/api/addons.html)
 build/Release
 
 # Dependency directories
 node_modules/
 jspm_packages/
 
-# Snowpack dependency directory (https://snowpack.dev/)
-web_modules/
-
-# TypeScript cache
-*.tsbuildinfo
+# Typescript v1 declaration files
+typings/
 
 # Optional npm cache directory
 .npm
@@ -53,12 +47,6 @@ web_modules/
 # Optional eslint cache
 .eslintcache
 
-# Microbundle cache
-.rpt2_cache/
-.rts2_cache_cjs/
-.rts2_cache_es/
-.rts2_cache_umd/
-
 # Optional REPL history
 .node_repl_history
 
@@ -70,48 +58,51 @@ web_modules/
 
 # dotenv environment variables file
 .env
-.env.test
 
-# parcel-bundler cache (https://parceljs.org/)
-.cache
-.parcel-cache
+### JetBrains template
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
 
-# Next.js build output
-.next
-out
+# User-specific stuff:
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/dictionaries
 
-# Nuxt.js build / generate output
-.nuxt
-dist
+# Sensitive or high-churn files:
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.xml
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
 
-# Gatsby files
-.cache/
-# Comment in the public line in if your project uses Gatsby and not Next.js
-# https://nextjs.org/blog/next-9-1#public-directory-support
-# public
+# Gradle:
+.idea/**/gradle.xml
+.idea/**/libraries
 
-# vuepress build output
-.vuepress/dist
+# Mongo Explorer plugin:
+.idea/**/mongoSettings.xml
 
-# Serverless directories
-.serverless/
+## File-based project format:
+*.iws
 
-# FuseBox cache
-.fusebox/
+## Plugin-specific files:
 
-# DynamoDB Local files
-.dynamodb/
+# IntelliJ
+/out/
 
-# TernJS port file
-.tern-port
+# mpeltonen/sbt-idea plugin
+.idea_modules/
 
-# Stores VSCode versions used for testing VSCode extensions
-.vscode-test
+# JIRA plugin
+atlassian-ide-plugin.xml
 
-# yarn v2
-.yarn/cache
-.yarn/unplugged
-.yarn/build-state.yml
-.yarn/install-state.gz
-.pnp.*
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
 
+/dist/
+.vscode

+ 1 - 0
web/.npmrc

@@ -0,0 +1 @@
+registry=https://registry.npm.taobao.org

+ 2 - 2
web/index.html

@@ -2,10 +2,10 @@
 <html lang="en">
 <head>
     <meta charset="UTF-8">
-    <title>马哥教育React项目</title>
+    <title>React项目</title>
 </head>
 <body>
-<h1>马哥教育React项目 测试程序</h1>
+<h1>React项目 测试程序</h1>
 <hr>
 <div id="root"></div>
 <script src="/assets/bundle.js"></script>

文件差异内容过多而无法显示
+ 757 - 686
web/package-lock.json


+ 1 - 1
web/package.json

@@ -9,7 +9,7 @@
     "build": "webpack -p --config webpack.config.prod.js"
   },
   "repository": {},
-  "author": "xielq",
+  "author": "magedu",
   "license": "MIT",
   "devDependencies": {
     "babel-core": "^6.24.1",

+ 9 - 1
web/src/index.js

@@ -1,6 +1,7 @@
 import React from 'react';
 import { render } from 'react-dom';
 import { AppContainer } from 'react-hot-loader';
+// import { hot } from 'react-hot-loader/root';
 import AppState from './AppState';
 import App from './App';
 
@@ -15,4 +16,11 @@ render(
 
 if (module.hot) {
   module.hot.accept('./App', () => { render(App) })
-}
+}
+
+// hot(App);
+// const appState = new AppState();
+
+// render(
+//   <App appState={appState} />, document.getElementById('root')
+// );

部分文件因为文件数量过多而无法显示