Skip to content

Commit

Permalink
- adding preserveSymLink: true support using .env variables.
Browse files Browse the repository at this point in the history
- updated README to reflect preserveSymLink instruction.
  • Loading branch information
janadh committed Dec 20, 2024
1 parent 80f1435 commit c7919e2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions apps/smart-forms-app/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions apps/smart-forms-app/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions apps/smart-forms-app/src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check failure on line 34 in apps/smart-forms-app/src/vite-env.d.ts

View workflow job for this annotation

GitHub Actions / Lint

Delete `⏎`
}

interface ImportMeta {
Expand Down
5 changes: 4 additions & 1 deletion apps/smart-forms-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()],
Expand All @@ -13,5 +15,6 @@ export default defineConfig({
include: [/node_modules/, '@aehrc/sdc-assemble', '@aehrc/sdc-populate']
}
},
resolve: { preserveSymlinks: true }
resolve: { preserveSymlinks: preserveSymlinks }
});

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c7919e2

Please sign in to comment.