// Array.from polyfill
import 'core-js/fn/array/from';
// Object.assign polyfill
import 'core-js/es6/object';
// Symbol polyfill
import 'core-js/es6/symbol';
// React
import React from 'react';
import ReactRouter from 'react-router';
// App core
import App from './app/index.js';
// User routes
import routes from './routes.js';
import basePath from './helpers/base-path.js';

const appInstance = (
    <ReactRouter.Route name="app" path={basePath} handler={App}>
        {routes}
    </ReactRouter.Route>
);

const Bootstrapper = {
    start() {
        ReactRouter.run(appInstance, ReactRouter.HistoryLocation, function(Handler) {
            React.render(<Handler />, document.getElementById('mainContainer'));
        });
    },
};

export default Bootstrapper;

// Array.from polyfill
import 'core-js/fn/array/from';
// Object.assign polyfill
import 'core-js/es6/object';
// Symbol polyfill
import 'core-js/es6/symbol';
// React
import React from 'react';
import ReactRouter from 'react-router';
// App core
import App from './app/index.js';
// User routes
import routes from './routes.js';
import basePath from './helpers/base-path.js';
import analytics from './helpers/analytics.js';

const appInstance = (
    <ReactRouter.Route name="app" path={basePath} handler={App}>
        {routes}
    </ReactRouter.Route>
);

const Bootstrapper = {
    start() {
        ReactRouter.run(appInstance, ReactRouter.HistoryLocation, function(Handler, state) {
            React.render(<Handler />, document.getElementById('mainContainer'));
            analytics.addEvent('pageviews', {
                path   : state.path,
                action : state.action,
            });
        });
    },
};

export default Bootstrapper;

Add basic pageview event tracking
:bar_chart: Add basic pageview event tracking
