From e73f1a74f3f66f2e662676d208a2cdc3f55c099f Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 12 Nov 2024 13:56:47 -0800 Subject: [PATCH] webpack: Remove resolve.extensions from config. Signed-off-by: Anders Kaseorg --- web/webpack.assets.json | 98 ++++++++++++++++++------------------- web/webpack.config.ts | 6 +-- web/webpack.dev-assets.json | 20 ++++---- 3 files changed, 60 insertions(+), 64 deletions(-) diff --git a/web/webpack.assets.json b/web/webpack.assets.json index 84fb481021..d103120ccb 100644 --- a/web/webpack.assets.json +++ b/web/webpack.assets.json @@ -1,82 +1,82 @@ { "activity": [ "./third/bootstrap/css/bootstrap.portico.css", - "./src/bundles/common", + "./src/bundles/common.ts", "sorttable", "./styles/portico/activity.css" ], "billing": [ - "./src/bundles/portico", - "./src/billing/helpers", - "./src/billing/billing", + "./src/bundles/portico.ts", + "./src/billing/helpers.ts", + "./src/billing/billing.ts", "./styles/portico/billing.css" ], "sponsorship": [ - "./src/bundles/portico", + "./src/bundles/portico.ts", "jquery-validation", - "./src/portico/signup", - "./src/billing/sponsorship", + "./src/portico/signup.ts", + "./src/billing/sponsorship.ts", "./styles/portico/billing.css" ], "billing_auth": [ - "./src/bundles/portico", - "./src/billing/helpers", + "./src/bundles/portico.ts", + "./src/billing/helpers.ts", "jquery-validation", - "./src/billing/remote_billing_auth", - "./src/billing/deactivate_server", + "./src/billing/remote_billing_auth.ts", + "./src/billing/deactivate_server.ts", "./styles/portico/billing.css" ], "upgrade": [ - "./src/bundles/portico", - "./src/billing/helpers", - "./src/billing/upgrade", + "./src/bundles/portico.ts", + "./src/billing/helpers.ts", + "./src/billing/upgrade.ts", "jquery-validation", "./styles/portico/billing.css" ], "billing-event-status": [ - "./src/bundles/portico", - "./src/billing/event_status", - "./src/billing/helpers", + "./src/bundles/portico.ts", + "./src/billing/event_status.ts", + "./src/billing/helpers.ts", "./styles/portico/billing.css" ], - "portico": ["./src/bundles/portico"], + "portico": ["./src/bundles/portico.ts"], "error-styles": [ "./third/bootstrap/css/bootstrap.portico.css", "./styles/portico/portico_styles.css" ], - "common": ["./src/bundles/common"], + "common": ["./src/bundles/common.ts"], "help": [ - "./src/bundles/portico", + "./src/bundles/portico.ts", "simplebar/dist/simplebar.css", "simplebar", - "./src/portico/help", - "./src/portico/tabbed-instructions" + "./src/portico/help.ts", + "./src/portico/tabbed-instructions.ts" ], "landing-page": [ - "./src/bundles/portico", - "./src/portico/landing-page", + "./src/bundles/portico.ts", + "./src/portico/landing-page.ts", "./styles/portico/landing_page.css" ], "landing-page-with-pricing": [ - "./src/bundles/portico", - "./src/portico/landing-page", + "./src/bundles/portico.ts", + "./src/portico/landing-page.ts", "./styles/portico/landing_page.css", "./styles/portico/pricing_plans.css" ], "landing-page-hello": [ - "./src/bundles/hello", - "./src/portico/hello", - "./src/portico/landing-page", - "./src/portico/header", + "./src/bundles/hello.ts", + "./src/portico/hello.ts", + "./src/portico/landing-page.ts", + "./src/portico/header.ts", "./styles/portico/svg_icons.css", "./styles/portico/hello.css", "./styles/portico/navbar.css", "./styles/portico/footer.css" ], "plans-page": [ - "./src/bundles/hello", - "./src/portico/landing-page", - "./src/portico/header", + "./src/bundles/hello.ts", + "./src/portico/landing-page.ts", + "./src/portico/header.ts", "./styles/portico/hello.css", "./styles/portico/navbar.css", "./styles/portico/footer.css", @@ -85,36 +85,36 @@ "./styles/portico/comparison_table.css" ], "integrations": [ - "./src/bundles/portico", - "./src/portico/integrations", + "./src/bundles/portico.ts", + "./src/portico/integrations.js", "./styles/portico/landing_page.css", "./styles/portico/integrations.css" ], "communities": [ - "./src/bundles/portico", - "./src/portico/communities", + "./src/bundles/portico.ts", + "./src/portico/communities.ts", "./styles/portico/landing_page.css", "./styles/portico/integrations.css" ], - "signup": ["./src/bundles/portico", "jquery-validation", "./src/portico/signup"], - "register": ["./src/bundles/portico", "jquery-validation", "./src/portico/signup"], + "signup": ["./src/bundles/portico.ts", "jquery-validation", "./src/portico/signup.ts"], + "register": ["./src/bundles/portico.ts", "jquery-validation", "./src/portico/signup.ts"], "confirm-preregistrationuser": [ "./third/bootstrap/css/bootstrap.portico.css", - "./src/bundles/common", - "./src/portico/confirm-preregistrationuser" + "./src/bundles/common.ts", + "./src/portico/confirm-preregistrationuser.ts" ], "support": [ "./third/bootstrap/css/bootstrap.portico.css", - "./src/bundles/common", + "./src/bundles/common.ts", "sorttable", "./styles/portico/activity.css", - "./src/support/support", - "./src/portico/tippyjs", + "./src/support/support.ts", + "./src/portico/tippyjs.ts", "tippy.js/dist/tippy.css" ], - "desktop-login": ["./src/bundles/portico", "./src/portico/desktop-login"], - "desktop-redirect": ["./src/bundles/portico", "./src/portico/desktop-redirect"], - "stats": ["./src/bundles/portico", "./styles/portico/stats.css", "./src/stats/stats"], - "app": ["./src/bundles/app"], - "digest": ["./src/bundles/portico"] + "desktop-login": ["./src/bundles/portico.ts", "./src/portico/desktop-login.ts"], + "desktop-redirect": ["./src/bundles/portico.ts", "./src/portico/desktop-redirect.ts"], + "stats": ["./src/bundles/portico.ts", "./styles/portico/stats.css", "./src/stats/stats.ts"], + "app": ["./src/bundles/app.ts"], + "digest": ["./src/bundles/portico.ts"] } diff --git a/web/webpack.config.ts b/web/webpack.config.ts index d52ee034b5..7fff3a083d 100644 --- a/web/webpack.config.ts +++ b/web/webpack.config.ts @@ -73,7 +73,7 @@ const config = ( : Object.fromEntries( Object.entries({...assets, ...dev_assets}).map(([name, paths]) => [ name, - [...paths, "./src/debug"], + [...paths, "./src/debug.ts"], ]), ), module: { @@ -209,10 +209,6 @@ const config = ( chunkFilename: production ? "[contenthash].js" : "[id].js", crossOriginLoading: "anonymous", }, - resolve: { - ...baseConfig.resolve, - extensions: [".ts", ".js"], - }, // We prefer cheap-module-source-map over any eval-* options // because stacktrace-gps doesn't currently support extracting // the source snippets with the eval-* options. diff --git a/web/webpack.dev-assets.json b/web/webpack.dev-assets.json index 376599af98..d50b045065 100644 --- a/web/webpack.dev-assets.json +++ b/web/webpack.dev-assets.json @@ -1,18 +1,18 @@ { - "dev-login": ["./src/bundles/portico", "./src/portico/dev-login"], + "dev-login": ["./src/bundles/portico.ts", "./src/portico/dev-login.ts"], "dev-integrations-panel": [ - "./src/bundles/portico", - "./src/portico/integrations_dev_panel", + "./src/bundles/portico.ts", + "./src/portico/integrations_dev_panel.ts", "./styles/portico/integrations_dev_panel.css", - "./src/reload_state", - "./src/channel" + "./src/reload_state.ts", + "./src/channel.ts" ], "dev-email-log": [ - "./src/bundles/common", - "./src/portico/email_log", - "./src/portico/portico_modals", + "./src/bundles/common.ts", + "./src/portico/email_log.ts", + "./src/portico/portico_modals.ts", "./styles/portico/email_log.css", - "./src/reload_state", - "./src/channel" + "./src/reload_state.ts", + "./src/channel.ts" ] }