1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-25 00:18:07 +00:00

Added separated dev build with sentry.io

This commit is contained in:
Vladimir Volek 2018-09-19 16:55:09 +02:00
parent 4ea7f68250
commit 93d3ccbd3a
7 changed files with 29 additions and 13 deletions

View File

@ -1,4 +1,6 @@
public
build
build-devel
coverage
images
node_modules

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
build
build-devel
# Dependency directory
node_modules

View File

@ -10,8 +10,9 @@
"scripts": {
"dev": "npx webpack-dev-server --config ./webpack/dev.babel.js",
"dev:local": "npx webpack-dev-server --config ./webpack/local.babel.js",
"build:clean": "rm -rf build",
"build:clean": "rimraf build build-devel",
"build:production": "npx webpack --config ./webpack/production.babel.js --progress --bail",
"build:dev": "cross-env BUILD=development npx webpack --config ./webpack/production.babel.js --output-path build-devel --progress --bail",
"build": "run-s build:*",
"flow": "flow check src",
"lint": "run-s lint:*",
@ -27,6 +28,7 @@
"bignumber.js": "2.4.0",
"color-hash": "^1.0.3",
"copy-webpack-plugin": "^4.5.2",
"cross-env": "^5.2.0",
"date-fns": "^1.29.0",
"ethereumjs-tx": "^1.3.3",
"ethereumjs-units": "^0.2.0",
@ -54,6 +56,7 @@
"redux-logger": "^3.0.6",
"redux-raven-middleware": "^1.2.0",
"redux-thunk": "^2.2.0",
"rimraf": "^2.6.2",
"styled-components": "^3.3.3",
"styled-media-query": "^2.0.2",
"styled-normalize": "^8.0.0",

View File

@ -3,8 +3,6 @@
import { createStore, applyMiddleware, compose } from 'redux';
import { routerMiddleware } from 'react-router-redux';
import thunk from 'redux-thunk';
// import createHistory from 'history/createBrowserHistory';
// import { useRouterHistory } from 'react-router';
import createHistory from 'history/createHashHistory';
import { createLogger } from 'redux-logger';
import reducers from 'reducers';
@ -17,17 +15,21 @@ import type { Action, GetState, Store } from 'flowtype';
export const history: History = createHistory({ queryKey: false });
const RAVEN_KEY: string = 'https://497392c3ff6e46dc9e54eef123979378@sentry.io/294339';
Raven.config(RAVEN_KEY).install();
const initialState: any = {};
const enhancers = [];
const middleware = [
const middlewares = [
thunk,
RavenMiddleware(RAVEN_KEY),
routerMiddleware(history),
];
// sentry io middleware only in dev build
if (process.env.BUILD === 'development') {
const RAVEN_KEY = 'https://34b8c09deb6c4cd2a4dc3f0029cd02d8@sentry.io/1279550';
const ravenMiddleware = RavenMiddleware(RAVEN_KEY);
Raven.config(RAVEN_KEY).install();
middlewares.push(ravenMiddleware);
}
let composedEnhancers: any;
if (process.env.NODE_ENV === 'development') {
@ -50,13 +52,12 @@ if (process.env.NODE_ENV === 'development') {
}
composedEnhancers = compose(
applyMiddleware(logger, ...middleware, ...services),
applyMiddleware(logger, ...middlewares, ...services),
...enhancers,
);
} else {
composedEnhancers = compose(
applyMiddleware(...middleware, ...services),
applyMiddleware(...middlewares, ...services),
...enhancers,
);
}

View File

@ -7,7 +7,6 @@ import {
SRC, BUILD, PORT, PUBLIC,
} from './constants';
module.exports = {
watch: true,
mode: 'development',

View File

@ -60,6 +60,9 @@ module.exports = {
hints: false,
},
plugins: [
new webpack.DefinePlugin({
'process.env.BUILD': JSON.stringify(process.env.BUILD),
}),
new HtmlWebpackPlugin({
chunks: ['index'],
template: `${SRC}index.html`,

View File

@ -2799,6 +2799,13 @@ create-hmac@^1.1.4:
safe-buffer "^5.0.1"
sha.js "^2.4.8"
cross-env@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2"
dependencies:
cross-spawn "^6.0.5"
is-windows "^1.0.0"
cross-spawn@^4.0.0:
version "4.0.2"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41"
@ -5551,7 +5558,7 @@ is-whitespace-character@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.2.tgz#ede53b4c6f6fb3874533751ec9280d01928d03ed"
is-windows@^1.0.1, is-windows@^1.0.2:
is-windows@^1.0.0, is-windows@^1.0.1, is-windows@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"