commit 605d7e4e1d0e4466ae06900eac69204478f0e9b0
parent 223cfa80bb9938810ce6f6d879d302e8a69eca14
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Thu, 16 Mar 2017 11:54:42 +0300
do not setup raven in development environment
Diffstat:
4 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js
@@ -204,7 +204,8 @@ module.exports = {
// to restart the development server for Webpack to discover it. This plugin
// makes the discovery automatic so you don't have to restart.
// See https://github.com/facebookincubator/create-react-app/issues/186
- new WatchMissingNodeModulesPlugin(paths.appNodeModules)
+ new WatchMissingNodeModulesPlugin(paths.appNodeModules),
+ new webpack.DefinePlugin({'NODE_ENV': JSON.stringify(process.env.NODE_ENV)}),
],
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js
@@ -247,8 +247,9 @@ module.exports = {
name: 'vendor',
minChunks: function(module, count) {
return module.resource && (/node_modules|vendored/).test(module.resource)
- }
+ },
}),
+ new webpack.DefinePlugin({'NODE_ENV': JSON.stringify(process.env.NODE_ENV)}),
],
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
diff --git a/src/index.js b/src/index.js
@@ -3,7 +3,11 @@ import './index.css';
import App from './App'
import config from './config';
-Raven.config(config.sentryDSN).install();
+/* eslint-disable no-undef */
+if (NODE_ENV === 'production') {
+/* eslint-enable no-undef */
+ Raven.config(config.sentryDSN).install();
+}
const oldOnunhandledrejection = window.onunhandledrejection;
diff --git a/src/lib/print.magnetic-meridian.js b/src/lib/print.magnetic-meridian.js
@@ -0,0 +1,3 @@
+/**
+ * Created by w on 3/16/17.
+ */