diff --git a/README.md b/README.md index d912f353..632d043c 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,9 @@ VITE_LAUNCH_CLIENT_ID=smart-forms In development mode, create a `.env.local` file in the `apps/smart-forms-app` directory and tweak the environment variables as needed. +> Note: in the local development mode, set +VITE_PRESERVE_SYM_LINKS=false so that it allows `tsc -w` to watch the latest changes. If preserveSymLink: true local changes will be ignored. + ### Run app locally diff --git a/apps/smart-forms-app/.env b/apps/smart-forms-app/.env index fd0bbb6d..3b49ad87 100644 --- a/apps/smart-forms-app/.env +++ b/apps/smart-forms-app/.env @@ -5,3 +5,4 @@ VITE_LAUNCH_SCOPE=fhirUser online_access openid profile patient/Condition.rs pat VITE_LAUNCH_CLIENT_ID=a57d90e3-5f69-4b92-aa2e-2992180863c1 VITE_IN_APP_POPULATE=true +VITE_PRESERVE_SYM_LINKS=true diff --git a/apps/smart-forms-app/.env.production b/apps/smart-forms-app/.env.production index fd0bbb6d..3b49ad87 100644 --- a/apps/smart-forms-app/.env.production +++ b/apps/smart-forms-app/.env.production @@ -5,3 +5,4 @@ VITE_LAUNCH_SCOPE=fhirUser online_access openid profile patient/Condition.rs pat VITE_LAUNCH_CLIENT_ID=a57d90e3-5f69-4b92-aa2e-2992180863c1 VITE_IN_APP_POPULATE=true +VITE_PRESERVE_SYM_LINKS=true diff --git a/apps/smart-forms-app/src/vite-env.d.ts b/apps/smart-forms-app/src/vite-env.d.ts index 517f185a..f1cf6ad6 100644 --- a/apps/smart-forms-app/src/vite-env.d.ts +++ b/apps/smart-forms-app/src/vite-env.d.ts @@ -30,6 +30,8 @@ interface ImportMetaEnv { readonly VITE_LAUNCH_CLIENT_ID: string; readonly VITE_IN_APP_POPULATE: boolean; readonly VITE_SHOW_DEBUG_MODE: string; + readonly VITE_PRESERVE_SYM_LINKS: boolean; + } interface ImportMeta { diff --git a/apps/smart-forms-app/vite.config.ts b/apps/smart-forms-app/vite.config.ts index 3436febf..2fdc99b3 100644 --- a/apps/smart-forms-app/vite.config.ts +++ b/apps/smart-forms-app/vite.config.ts @@ -2,6 +2,8 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import svgr from 'vite-plugin-svgr'; +const preserveSymlinks = process.env.VITE_PRESERVE_SYM_LINKS === 'true';//resolve preserveSymlink to boolean(Explicitly parse the string to a boolean) + // https://vitejs.dev/config/ export default defineConfig({ plugins: [react(), svgr()], @@ -13,5 +15,6 @@ export default defineConfig({ include: [/node_modules/, '@aehrc/sdc-assemble', '@aehrc/sdc-populate'] } }, - resolve: { preserveSymlinks: true } + resolve: { preserveSymlinks: preserveSymlinks } }); + diff --git a/package-lock.json b/package-lock.json index bd2238bb..356f9070 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "smart-forms", + "name": "smart-forms-alpha-jv", "lockfileVersion": 3, "requires": true, "packages": {