To complete signup, click the confirmation link in your inbox. If it doesn't arrive within 3 minutes, check your spam folder!
+{t(`To complete signup, click the confirmation link in your inbox. If it doesn't arrive within 3 minutes, check your spam folder!`)}
); }; diff --git a/ghost/signup-form/tsconfig.json b/ghost/signup-form/tsconfig.json index c81ef9f382..c75bff6415 100644 --- a/ghost/signup-form/tsconfig.json +++ b/ghost/signup-form/tsconfig.json @@ -12,6 +12,8 @@ "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, /* Linting */ "strict": true, diff --git a/ghost/signup-form/vite.config.ts b/ghost/signup-form/vite.config.ts index 48f42503cc..4d775a20e0 100644 --- a/ghost/signup-form/vite.config.ts +++ b/ghost/signup-form/vite.config.ts @@ -1,6 +1,8 @@ +import commonjs from 'vite-plugin-commonjs'; import pkg from './package.json'; import react from '@vitejs/plugin-react'; import svgr from 'vite-plugin-svgr'; +import {SUPPORTED_LOCALES} from '@tryghost/i18n'; import {defineConfig} from 'vitest/config'; import {resolve} from 'path'; @@ -11,7 +13,12 @@ export default (function viteConfig() { return defineConfig({ plugins: [ svgr(), - react() + react(), + commonjs({ + dynamic: { + loose: true + } + }) ], define: { 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV), @@ -42,7 +49,9 @@ export default (function viteConfig() { output: {} }, commonjsOptions: { - include: [/packages/, /node_modules/] + include: [/ghost/, /node_modules/], + dynamicRequireRoot: '../', + dynamicRequireTargets: SUPPORTED_LOCALES.map(locale => `../i18n/locales/${locale}/signup-form.json`) } }, test: { diff --git a/yarn.lock b/yarn.lock index ffc526c07a..d69fc6bcdd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16090,6 +16090,11 @@ es-module-lexer@^0.9.0, es-module-lexer@^0.9.3: resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== +es-module-lexer@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.2.1.tgz#ba303831f63e6a394983fde2f97ad77b22324527" + integrity sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg== + es-set-tostringtag@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" @@ -32680,11 +32685,29 @@ vite-node@0.31.4: picocolors "^1.0.0" vite "^3.0.0 || ^4.0.0" +vite-plugin-commonjs@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/vite-plugin-commonjs/-/vite-plugin-commonjs-0.7.1.tgz#7e0d20264d355b733e46ed4ed0e7931a113b47e9" + integrity sha512-pRkI+pKW3NygFGTiLRejEntiJL0N+yC1wpnzne2bQ/bAqYwZWAzFU7XgU6EC8GE898ZAKfAZ6bhDP+uL+pM61Q== + dependencies: + acorn "^8.8.2" + fast-glob "^3.2.12" + vite-plugin-dynamic-import "^1.4.0" + vite-plugin-css-injected-by-js@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/vite-plugin-css-injected-by-js/-/vite-plugin-css-injected-by-js-3.1.1.tgz#8324412636cf6fdada1a86f595aa2e78458e5ddb" integrity sha512-mwrFvEEy0TuH8Ul0cb2HgjmNboQ/JnEFy+kHCWqAJph3ikMOiIuyYVdx0JO4nEIWJyzSnc4TTdmoTulsikvJEg== +vite-plugin-dynamic-import@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/vite-plugin-dynamic-import/-/vite-plugin-dynamic-import-1.4.0.tgz#681fd38e40b36a4d312092b16a2cd96d735ed9d1" + integrity sha512-OBWeCGyWE4iIwCUfx3RK8XwT1BjPAJNeMQmdO5md5Gq8PD8gLMCfUnuEiX9dIQDL9Gdvao1GNRqZwfcpwWDTNw== + dependencies: + acorn "^8.8.2" + es-module-lexer "^1.2.1" + fast-glob "^3.2.12" + vite-plugin-svgr@3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/vite-plugin-svgr/-/vite-plugin-svgr-3.2.0.tgz#920375aaf6635091c9ac8e467825f92d32544476"