mirror of
https://github.com/zulip/zulip.git
synced 2025-10-26 01:24:02 +00:00
webpack: Use assets object immutably.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
fa3ea59833
commit
5006255069
@@ -26,7 +26,14 @@ export default (env?: string): webpack.Configuration[] => {
|
|||||||
name: "frontend",
|
name: "frontend",
|
||||||
mode: production ? "production" : "development",
|
mode: production ? "production" : "development",
|
||||||
context: __dirname,
|
context: __dirname,
|
||||||
entry: assets,
|
entry: production
|
||||||
|
? assets
|
||||||
|
: Object.fromEntries(
|
||||||
|
Object.entries(assets).map(([name, paths]) => [
|
||||||
|
name,
|
||||||
|
[...paths, "./static/js/debug"],
|
||||||
|
]),
|
||||||
|
),
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
@@ -256,10 +263,6 @@ export default (env?: string): webpack.Configuration[] => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!production) {
|
if (!production) {
|
||||||
// Out JS debugging tools
|
|
||||||
for (const paths of Object.values(assets)) {
|
|
||||||
paths.push("./static/js/debug");
|
|
||||||
}
|
|
||||||
config.devServer = {
|
config.devServer = {
|
||||||
clientLogLevel: "error",
|
clientLogLevel: "error",
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
Reference in New Issue
Block a user