deps: update to webpack 4

This commit is contained in:
Saúl Ibarra Corretgé 2018-12-03 14:39:37 +01:00 committed by Saúl Ibarra Corretgé
parent 66832ada68
commit 45291e1054
3 changed files with 3039 additions and 1868 deletions

4866
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -50,7 +50,7 @@
"jsc-android": "224109.1.0",
"jsrsasign": "8.0.12",
"jwt-decode": "2.2.0",
"lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#03411c7488c32593b439fc80b239ab3b7abd5e11",
"lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#81dac6051eb7e86e51a94eca96eae10add9dc7fb",
"libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
"lodash": "4.17.11",
"moment": "2.19.4",
@ -114,9 +114,9 @@
"precommit-hook": "3.0.0",
"string-replace-loader": "1.3.0",
"style-loader": "0.19.0",
"uglifyjs-webpack-plugin": "1.2.2",
"webpack": "3.9.1",
"webpack-dev-server": "2.9.5"
"webpack": "4.26.1",
"webpack-cli": "3.1.2",
"webpack-dev-server": "3.1.10"
},
"engines": {
"node": ">=8.0.0",

View File

@ -1,8 +1,6 @@
/* global __dirname */
const process = require('process');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const webpack = require('webpack');
/**
* The URL of the Jitsi Meet deployment to be proxy to in the context of
@ -15,31 +13,6 @@ const minimize
= process.argv.indexOf('-p') !== -1
|| process.argv.indexOf('--optimize-minimize') !== -1;
const plugins = [
new webpack.LoaderOptionsPlugin({
debug: !minimize,
minimize
})
];
if (minimize) {
// XXX Webpack's command line argument -p is not enough. Further
// optimizations are made possible by the use of DefinePlugin and NODE_ENV
// with value 'production'. For example, React takes advantage of these.
plugins.push(new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
}));
plugins.push(new webpack.optimize.ModuleConcatenationPlugin());
plugins.push(new UglifyJsPlugin({
cache: true,
extractComments: true,
parallel: true,
sourceMap: true
}));
}
// The base Webpack configuration to bundle the JavaScript artifacts of
// jitsi-meet such as app.bundle.js and external_api.js.
const config = {
@ -55,6 +28,7 @@ const config = {
}
},
devtool: 'source-map',
mode: minimize ? 'development' : 'production',
module: {
rules: [ {
// Transpile ES2015 (aka ES6) to ES5. Accept the JSX syntax by React
@ -112,13 +86,16 @@ const config = {
// value that is a mock (/index.js).
__filename: true
},
optimization: {
concatenateModules: minimize,
minimize
},
output: {
filename: `[name]${minimize ? '.min' : ''}.js`,
path: `${__dirname}/build`,
publicPath: '/libs/',
sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map`
},
plugins,
resolve: {
alias: {
jquery: `jquery/dist/jquery${minimize ? '.min' : ''}.js`