Speed webpack up

This commit is contained in:
Lyubo Marinov 2017-06-15 22:47:04 -05:00
parent 0d7aea377a
commit 1da49d86a1
2 changed files with 37 additions and 45 deletions

51
app.js
View File

@ -15,28 +15,39 @@ import 'aui-experimental-css';
window.toastr = require('toastr'); window.toastr = require('toastr');
export conference from './conference'; import conference from './conference';
export API from './modules/API'; import API from './modules/API';
export keyboardshortcut from './modules/keyboardshortcut/keyboardshortcut'; import keyboardshortcut from './modules/keyboardshortcut/keyboardshortcut';
export remoteControl from './modules/remotecontrol/RemoteControl'; import remoteControl from './modules/remotecontrol/RemoteControl';
export settings from './modules/settings/Settings'; import settings from './modules/settings/Settings';
export translation from './modules/translation/translation'; import translation from './modules/translation/translation';
export UI from './modules/UI/UI'; import UI from './modules/UI/UI';
// Used by do_external_connect.js if we receive the attach data after connect window.APP = {
// was already executed. status property can be 'initialized', 'ready', or API,
// 'connecting'. We are interested in 'ready' status only which means that conference,
// connect was executed but we have to wait for the attach data. In status
// 'ready' handler property will be set to a function that will finish the
// connect process when the attach data or error is received.
export const connect = {
handler: null,
status: 'initialized'
};
// Used for automated performance tests // Used by do_external_connect.js if we receive the attach data after
export const connectionTimes = { // connect was already executed. status property can be 'initialized',
'index.loaded': window.indexLoadedTime // 'ready', or 'connecting'. We are interested in 'ready' status only which
// means that connect was executed but we have to wait for the attach data.
// In status 'ready' handler property will be set to a function that will
// finish the connect process when the attach data or error is received.
connect: {
handler: null,
status: 'initialized'
},
// Used for automated performance tests.
connectionTimes: {
'index.loaded': window.indexLoadedTime
},
keyboardshortcut,
remoteControl,
settings,
translation,
UI
}; };
// TODO The execution of the mobile app starts from react/index.native.js. // TODO The execution of the mobile app starts from react/index.native.js.

View File

@ -147,7 +147,6 @@ const config = {
}, },
output: { output: {
filename: `[name]${minimize ? '.min' : ''}.js`, filename: `[name]${minimize ? '.min' : ''}.js`,
libraryTarget: 'umd',
path: `${__dirname}/build`, path: `${__dirname}/build`,
publicPath: '/libs/', publicPath: '/libs/',
sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map` sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map`
@ -175,36 +174,19 @@ const config = {
} }
}; };
const configs = [ module.exports = [
// The Webpack configuration to bundle app.bundle.js (aka APP).
Object.assign({}, config, { Object.assign({}, config, {
entry: { entry: {
'app.bundle': [ 'app.bundle': [
// XXX Required by at least IE11 at the time of this writing. // XXX Required by at least IE11 at the time of this writing.
'babel-polyfill', 'babel-polyfill',
'./app.js' './app.js'
] ],
},
output: Object.assign({}, config.output, {
library: 'APP'
})
}),
// The Webpack configuration to bundle device_selection_popup_bundle.js
// (i.e. js file for the device selection popup dialog).
Object.assign({}, config, {
entry: {
'device_selection_popup_bundle': 'device_selection_popup_bundle':
'./react/features/device-selection/popup.js' './react/features/device-selection/popup.js',
}
}),
// The Webpack configuration to bundle do_external_connect.js (which
// attempts to optimize Jitsi Meet's XMPP connection and, consequently, is
// also known as HTTP pre-bind).
Object.assign({}, config, {
entry: {
'do_external_connect': 'do_external_connect':
'./connection_optimization/do_external_connect.js' './connection_optimization/do_external_connect.js'
} }
@ -217,13 +199,12 @@ const configs = [
'external_api': './modules/API/external/index.js' 'external_api': './modules/API/external/index.js'
}, },
output: Object.assign({}, config.output, { output: Object.assign({}, config.output, {
library: 'JitsiMeetExternalAPI' library: 'JitsiMeetExternalAPI',
libraryTarget: 'umd'
}) })
}) })
]; ];
module.exports = configs;
/** /**
* Determines whether a specific (HTTP) request is to bypass the proxy of * Determines whether a specific (HTTP) request is to bypass the proxy of
* webpack-dev-server (i.e. is to be handled by the proxy target) and, if not, * webpack-dev-server (i.e. is to be handled by the proxy target) and, if not,