diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index e95cffd1..9756df5b 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -17,6 +17,13 @@ const paths = require("./paths"); const publicPath = "/"; const env = getClientEnvironment("/","development"); +const process = require('process'); + +process.on('uncaughtException', function (err) { + // 开发时,websocket proxy 会因服务重新部署而报错中断本地 server,这里拦截一下 + console.log('拦截未处理异常:', err); +}); + module.exports = { optimization: { splitChunks: { @@ -273,12 +280,11 @@ module.exports = { reactPath:'react.production.min.js', }), new InterpolateHtmlPlugin(HtmlWebpackPlugin, env.raw), - // Add module names to factory functions so they appear in browser profiler. new webpack.NamedModulesPlugin(), // Makes some environment variables available to the JS code, for example: // if (process.env.NODE_ENV === 'development') { ... }. See `./env.js`. - new webpack.DefinePlugin(env.stringified), + new webpack.DefinePlugin({ ...env.stringified, __SERVER__: 'false',__CLIENT__: 'true' }), // This is necessary to emit hot updates (currently CSS only): new webpack.HotModuleReplacementPlugin(), // Watcher doesn't work well if you mistype casing in a path so we use diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index a7811c3a..98c2f41b 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -294,6 +294,7 @@ module.exports = { minifyURLs: true, }, }), + new webpack.DefinePlugin({ ...env.stringified, __SERVER__: 'false',__CLIENT__: 'true' }), new InterpolateHtmlPlugin(HtmlWebpackPlugin, env.raw), // Makes some environment variables available to the JS code, for example: // if (process.env.NODE_ENV === 'production') { ... }. See `./env.js`. diff --git a/package.json b/package.json index f4507d91..c78b0e86 100644 --- a/package.json +++ b/package.json @@ -178,7 +178,7 @@ "eslintConfig": { "extends": "react-app" }, - "proxy": "http://172.20.32.202:4000", + "proxy": "https://testforgeplus.trustie.net", "port": "3007", "devDependencies": { "@babel/runtime": "7.0.0-beta.51", diff --git a/public/images/share_logo_icon.jpg b/public/images/share_logo_icon.jpg deleted file mode 100644 index 079ac434..00000000 Binary files a/public/images/share_logo_icon.jpg and /dev/null differ diff --git a/public/images/share_logo_icon.png b/public/images/share_logo_icon.png new file mode 100644 index 00000000..b6f6ece0 Binary files /dev/null and b/public/images/share_logo_icon.png differ diff --git a/public/index.html b/public/index.html index 06d38434..df06f237 100755 --- a/public/index.html +++ b/public/index.html @@ -50,6 +50,7 @@ + <%= htmlWebpackPlugin.tags.bodyTags %>