Skip to content

Commit

Permalink
webpack: Use assets object immutably.
Browse files Browse the repository at this point in the history
Signed-off-by: Anders Kaseorg <[email protected]>
  • Loading branch information
andersk authored and timabbott committed Sep 28, 2020
1 parent fa3ea59 commit 5006255
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ export default (env?: string): webpack.Configuration[] => {
name: "frontend",
mode: production ? "production" : "development",
context: __dirname,
entry: assets,
entry: production
? assets
: Object.fromEntries(
Object.entries(assets).map(([name, paths]) => [
name,
[...paths, "./static/js/debug"],
]),
),
module: {
rules: [
{
Expand Down Expand Up @@ -256,10 +263,6 @@ export default (env?: string): webpack.Configuration[] => {
};

if (!production) {
// Out JS debugging tools
for (const paths of Object.values(assets)) {
paths.push("./static/js/debug");
}
config.devServer = {
clientLogLevel: "error",
headers: {
Expand Down

0 comments on commit 5006255

Please sign in to comment.