import $ from 'jquery';
import _ from 'underscore';
import Backbone from 'backbone';
-import Marionette from 'backbone.marionette';
import 'whatwg-fetch';
import moment from 'moment';
-import numeral from 'numeral';
import './processes';
import Navigation from './nav/app';
import { installGlobal, requestMessages } from '../helpers/l10n';
-import React from 'react';
-import ReactDOM from 'react-dom';
-import d3 from 'd3';
import * as measures from '../helpers/measures';
import * as request from '../helpers/request';
.then(startNavigation)
.then(prepareAppOptions);
-// expose libraries
-window.require = module => {
- switch (module) {
- case 'backbone':
- return Backbone;
- case 'backbone.marionette':
- return Marionette;
- case 'moment':
- return moment;
- case 'numeral':
- return numeral;
- case 'react':
- return React;
- case 'react-dom':
- return ReactDOM;
- case 'd3':
- return d3;
- case 'sonar-measures':
- return measures;
- case 'sonar-request':
- return request;
- default:
- return null;
- }
-};
+window.SonarMeasures = measures;
+window.SonarRequest = request;
helperDirs: path.join(__dirname, 'src/main/js/helpers/handlebars')
}
},
- {
- test: require.resolve('jquery'),
- loader: 'expose?$!expose?jQuery'
- },
- {
- test: require.resolve('underscore'),
- loader: 'expose?_'
- },
- {
- test: require.resolve('d3'),
- loader: 'expose?d3'
- },
{
test: /\.css/,
loader: 'style-loader!css-loader!postcss-loader'
- }
+ },
+ { test: require.resolve('jquery'), loader: 'expose?$!expose?jQuery' },
+ { test: require.resolve('underscore'), loader: 'expose?_' },
+ { test: require.resolve('backbone'), loader: 'expose?Backbone' },
+ { test: require.resolve('backbone.marionette'), loader: 'expose?Marionette' },
+ { test: require.resolve('d3'), loader: 'expose?d3' },
+ { test: require.resolve('react'), loader: 'expose?React' },
+ { test: require.resolve('react-dom'), loader: 'expose?ReactDOM' },
+ { test: require.resolve('react-dom'), loader: 'expose?ReactDOM' }
]
},
postcss: function () {