webpack: Simplify externals declaration

This is simple enough to be inline, and it's also not meant to be
expanded: `cockpit` is the only legit external symbol, everything else
ought to be bundled.
This commit is contained in:
Martin Pitt 2020-11-22 12:19:38 +01:00 committed by Katerina Koukiou
parent 8ea62cb4d7
commit 8aad356edb

View file

@ -5,10 +5,6 @@ const fs = require("fs");
const webpack = require("webpack"); const webpack = require("webpack");
const CompressionPlugin = require("compression-webpack-plugin"); const CompressionPlugin = require("compression-webpack-plugin");
var externals = {
"cockpit": "cockpit",
};
/* These can be overridden, typically from the Makefile.am */ /* These can be overridden, typically from the Makefile.am */
const srcdir = (process.env.SRCDIR || __dirname) + path.sep + "src"; const srcdir = (process.env.SRCDIR || __dirname) + path.sep + "src";
const builddir = (process.env.SRCDIR || __dirname); const builddir = (process.env.SRCDIR || __dirname);
@ -115,7 +111,8 @@ module.exports = {
ignored: /node_modules/, ignored: /node_modules/,
}, },
entry: info.entries, entry: info.entries,
externals: externals, // cockpit.js gets included via <script>, everything else should be bundled
externals: { "cockpit": "cockpit" },
devtool: "source-map", devtool: "source-map",
module: { module: {
rules: [ rules: [