File tree Expand file tree Collapse file tree 5 files changed +42
-34
lines changed Expand file tree Collapse file tree 5 files changed +42
-34
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ this branch:
12
12
- [ ] Rethink external population process
13
13
- [x] Extract anchors into ` _content.json ` via ` DirectoryTreePlugin ` (Fernando)
14
14
- [ ] Finish re-incorporating mobile sidebar
15
- - [ ] Re-integrate google-analytics
15
+ - [x ] Re-integrate google-analytics (Fernando)
16
16
- [ ] Re-incorporate ` redirects.json `
17
17
- [x] Populate page title in ` server.jsx ` (Fernando)
18
18
- [ ] Finish ` Navigation ` component (greg)
Original file line number Diff line number Diff line change 111
111
"react" : " ^16.2.0" ,
112
112
"react-banner" : " ^0.5.0" ,
113
113
"react-dom" : " ^16.2.0" ,
114
+ "react-g-analytics" : " 0.4.2" ,
114
115
"react-hot-loader" : " ^4.0.0-beta.12" ,
115
116
"react-router" : " ^4.2.0" ,
116
117
"react-router-dom" : " ^4.2.2" ,
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import ReactDOM from 'react-dom' ;
3
- import { BrowserRouter , Route } from 'react-router-dom' ;
3
+ import { Route } from 'react-router-dom' ;
4
+ import { BrowserRouter } from 'react-g-analytics' ;
4
5
import Site from './components/Site/Site' ;
5
6
6
- // TODO: Re-integrate <GoogleAnalytics analyticsId="UA-46921629-2" />
7
- // Consider `react-g-analytics` package
7
+ let gaID ;
8
+
9
+ if ( process . env . NODE_ENV === 'production' ) {
10
+ gaID = 'UA-46921629-2' ;
11
+ }
8
12
9
13
// Client Side Rendering
10
14
if ( window . document !== undefined ) {
11
15
ReactDOM . render ( (
12
- < BrowserRouter >
16
+ < BrowserRouter id = { gaID } >
13
17
< Route
14
18
path = "/"
15
19
render = { props => (
Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ module.exports = (env = {}) => ({
36
36
loader : 'remark-loader' ,
37
37
options : {
38
38
plugins : [
39
- // TODO: Add necessary remark plugins
40
39
require ( './tip' ) ,
41
40
require ( 'remark-slug' ) ,
42
41
[
Original file line number Diff line number Diff line change @@ -5,31 +5,35 @@ const HTMLPlugin = require('html-webpack-plugin');
5
5
const HTMLTemplate = require ( 'html-webpack-template' ) ;
6
6
const common = require ( './webpack.common.js' ) ;
7
7
8
- module . exports = env => merge ( common ( env ) , {
9
- plugins : [
10
- new webpack . HotModuleReplacementPlugin ( ) ,
11
- new HTMLPlugin ( {
12
- inject : false ,
13
- template : HTMLTemplate ,
14
- title : 'webpack' ,
15
- appMountId : 'root' ,
16
- mobile : true ,
17
- favicon : './favicon.ico' ,
18
- meta : {
19
- description : '...'
20
- }
21
- } ) ,
22
- new webpack . optimize . CommonsChunkPlugin ( {
23
- name : 'vendor' ,
24
- chunks : [ 'index' ]
25
- } )
26
- ] ,
27
- devServer : {
28
- contentBase : path . resolve ( __dirname , './dist' ) ,
29
- port : 3000 ,
30
- hot : true ,
31
- inline : true ,
32
- compress : true ,
33
- historyApiFallback : true
34
- }
35
- } )
8
+ module . exports = env =>
9
+ merge ( common ( env ) , {
10
+ plugins : [
11
+ new webpack . HotModuleReplacementPlugin ( ) ,
12
+ new HTMLPlugin ( {
13
+ inject : false ,
14
+ template : HTMLTemplate ,
15
+ title : 'webpack' ,
16
+ appMountId : 'root' ,
17
+ mobile : true ,
18
+ favicon : './favicon.ico' ,
19
+ meta : {
20
+ description : '...'
21
+ }
22
+ } ) ,
23
+ new webpack . optimize . CommonsChunkPlugin ( {
24
+ name : 'vendor' ,
25
+ chunks : [ 'index' ]
26
+ } ) ,
27
+ new webpack . DefinePlugin ( {
28
+ 'process.env.NODE_ENV' : JSON . stringify ( 'development' )
29
+ } )
30
+ ] ,
31
+ devServer : {
32
+ contentBase : path . resolve ( __dirname , './dist' ) ,
33
+ port : 3000 ,
34
+ hot : true ,
35
+ inline : true ,
36
+ compress : true ,
37
+ historyApiFallback : true
38
+ }
39
+ } ) ;
You can’t perform that action at this time.
0 commit comments