Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Enes Tasbasi
whats-open-web
Commits
b50d4f42
Commit
b50d4f42
authored
Jan 19, 2018
by
Andrew Hrdy
Browse files
Redux dev tools not loaded in production, google analytics not loaded in develop.
parent
4958b167
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/index.html
View file @
b50d4f42
...
...
@@ -33,14 +33,6 @@
</head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src=
"https://www.googletagmanager.com/gtag/js?id=UA-112607180-1"
></script>
<script>
window
.
dataLayer
=
window
.
dataLayer
||
[];
function
gtag
()
{
dataLayer
.
push
(
arguments
);
}
gtag
(
'
js
'
,
new
Date
());
gtag
(
'
config
'
,
'
UA-112607180-1
'
);
</script>
<body>
<noscript>
...
...
src/index.js
View file @
b50d4f42
...
...
@@ -17,13 +17,17 @@ import 'typeface-roboto';
// Create a history of your choosing (we're using a browser history in this case)
const
history
=
createHistory
();
const
extension
=
window
.
__REDUX_DEVTOOLS_EXTENSION__
&&
window
.
__REDUX_DEVTOOLS_EXTENSION__
();
const
isProduction
=
process
.
env
.
NODE_ENV
===
'
production
'
;
le
t
enhance
;
cons
t
enhance
=
compose
(
applyMiddleware
(
ReduxThunk
,
routerMiddleware
(
history
)),
!
isProduction
&&
extension
)
;
if
(
extension
)
{
enhance
=
compose
(
applyMiddleware
(
ReduxThunk
,
routerMiddleware
(
history
)),
extension
);
}
else
{
enhance
=
compose
(
applyMiddleware
(
ReduxThunk
,
routerMiddleware
(
history
)));
if
(
isProduction
)
{
window
.
dataLayer
=
window
.
dataLayer
||
[];
const
gtag
=
(
args
)
=>
{
window
.
dataLayer
.
push
(
args
);
};
gtag
(
'
js
'
,
new
Date
());
gtag
(
'
config
'
,
'
UA-112607180-1
'
);
}
const
store
=
createStore
(
reducers
,
enhance
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment