From ced27783db78e31c54fadb201628fc759ca77b58 Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Fri, 12 Aug 2022 21:59:19 +0800 Subject: [PATCH] feat: copy i18n entry file --- package.json | 1 + scripts/i18n.mjs | 11 +++++++++++ tsconfig.json | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 scripts/i18n.mjs diff --git a/package.json b/package.json index 3213d2a..2f698da 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.0.0", "description": "", "scripts": { + "i18n": "node ./scripts/i18n.mjs", "start": "vite", "dev": "vite", "build": "vite build", diff --git a/scripts/i18n.mjs b/scripts/i18n.mjs new file mode 100644 index 0000000..6bb0905 --- /dev/null +++ b/scripts/i18n.mjs @@ -0,0 +1,11 @@ +import fs from "fs"; +import path from "path"; + +const root = "./src/lang"; +const entry = "entry.ts"; +const langs = fs.readdirSync(root); +langs + .filter((lang) => lang !== "en") + .forEach((lang) => { + fs.copyFileSync(path.join(root, "en", entry), path.join(root, lang, entry)); + }); diff --git a/tsconfig.json b/tsconfig.json index e93089f..a3fb84f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,7 @@ "jsxImportSource": "solid-js", "types": ["vite/client"], "noEmit": true, - "isolatedModules": true, + "isolatedModules": false, "paths": { "~/*":["./src/*"], "@solidjs/router": ["./solid-router/src/index.tsx"],