From 820fb3254eb3fa29152ed4b0df72b85b9c8581a1 Mon Sep 17 00:00:00 2001 From: Jakub Szymczak Date: Wed, 6 Dec 2023 13:56:47 +0100 Subject: [PATCH 1/2] rename .web files to .website files --- .../MapView/{Direction.web.tsx => Direction.website.tsx} | 0 src/components/MapView/{MapView.web.tsx => MapView.website.tsx} | 0 ...serDetailsTooltip.web.js => BaseUserDetailsTooltip.website.js} | 0 src/libs/Browser/{index.web.ts => index.website.ts} | 0 src/libs/StatusBar/{index.web.ts => index.website.ts} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename src/components/MapView/{Direction.web.tsx => Direction.website.tsx} (100%) rename src/components/MapView/{MapView.web.tsx => MapView.website.tsx} (100%) rename src/components/UserDetailsTooltip/{BaseUserDetailsTooltip.web.js => BaseUserDetailsTooltip.website.js} (100%) rename src/libs/Browser/{index.web.ts => index.website.ts} (100%) rename src/libs/StatusBar/{index.web.ts => index.website.ts} (100%) diff --git a/src/components/MapView/Direction.web.tsx b/src/components/MapView/Direction.website.tsx similarity index 100% rename from src/components/MapView/Direction.web.tsx rename to src/components/MapView/Direction.website.tsx diff --git a/src/components/MapView/MapView.web.tsx b/src/components/MapView/MapView.website.tsx similarity index 100% rename from src/components/MapView/MapView.web.tsx rename to src/components/MapView/MapView.website.tsx diff --git a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip.web.js b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip.website.js similarity index 100% rename from src/components/UserDetailsTooltip/BaseUserDetailsTooltip.web.js rename to src/components/UserDetailsTooltip/BaseUserDetailsTooltip.website.js diff --git a/src/libs/Browser/index.web.ts b/src/libs/Browser/index.website.ts similarity index 100% rename from src/libs/Browser/index.web.ts rename to src/libs/Browser/index.website.ts diff --git a/src/libs/StatusBar/index.web.ts b/src/libs/StatusBar/index.website.ts similarity index 100% rename from src/libs/StatusBar/index.web.ts rename to src/libs/StatusBar/index.website.ts From cd7ba79935aed99bfbf998e0567bbf8cfa1a868f Mon Sep 17 00:00:00 2001 From: Jakub Szymczak Date: Wed, 6 Dec 2023 14:07:51 +0100 Subject: [PATCH 2/2] make webpack take .website.tsx files --- config/webpack/webpack.common.js | 16 +++++++++++++++- tsconfig.json | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/config/webpack/webpack.common.js b/config/webpack/webpack.common.js index 8c74ebfd1686..008b4f45911f 100644 --- a/config/webpack/webpack.common.js +++ b/config/webpack/webpack.common.js @@ -211,7 +211,21 @@ const webpackConfig = ({envFile = '.env', platform = 'web'}) => ({ // This is also why we have to use .website.js for our own web-specific files... // Because desktop also relies on "web-specific" module implementations // This also skips packing web only dependencies to desktop and vice versa - extensions: ['.web.js', platform === 'web' ? '.website.js' : '.desktop.js', '.js', '.jsx', '.web.ts', platform === 'web' ? '.website.ts' : '.desktop.ts', '.ts', '.web.tsx', '.tsx'], + extensions: [ + '.web.js', + ...(platform === 'desktop' ? ['.desktop.js'] : []), + '.website.js', + '.js', + '.jsx', + '.web.ts', + ...(platform === 'desktop' ? ['.desktop.ts'] : []), + '.website.ts', + ...(platform === 'desktop' ? ['.desktop.tsx'] : []), + '.website.tsx', + '.ts', + '.web.tsx', + '.tsx', + ], fallback: { 'process/browser': require.resolve('process/browser'), }, diff --git a/tsconfig.json b/tsconfig.json index eafc7c375fdd..08447f306dd5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -47,5 +47,5 @@ } }, "exclude": ["**/node_modules/*", "**/dist/*", ".github/actions/**/index.js", "**/docs/*"], - "include": ["src", "desktop", "web", "docs", "assets", "config", "tests", "jest", "__mocks__", ".github/**/*", ".storybook/**/*"] + "include": ["src", "desktop", "web", "website", "docs", "assets", "config", "tests", "jest", "__mocks__", ".github/**/*", ".storybook/**/*"] }