Commit 1fb4274
authored
fix: replace import assertion with readFileSync in rollup configs (#1052)
* fix: replace import assertion with readFileSync in rollup configs
- Replace 'import packageJson from ./package.json assert { type: 'json' }' with readFileSync
- Fixes build error: SyntaxError: Unexpected identifier 'assert'
- Affects packages/auth and packages/api rollup.config.js files
- Uses Node.js fs.readFileSync which is compatible with Rollup parser
* fix: use 'with' syntax for JSON import assertions in rollup configs
- Replace readFileSync with 'with { type: 'json' }' import syntax
- Uses newer standard import attributes syntax
* fix: use createRequire with explicit path resolution for Node 16 compatibility
- Replace 'with { type: 'json' }' import syntax with createRequire approach
- Add fileURLToPath and path.dirname for explicit path resolution
- Ensures backward compatibility with Node.js 16.19.0
- Fixes build error during yarn install postinstall script
- Affects packages/auth and packages/api rollup.config.js files1 parent 4c3cfd1 commit 1fb4274
2 files changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
5 | 11 | | |
6 | 12 | | |
7 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
5 | 11 | | |
6 | 12 | | |
7 | 13 | | |
| |||
0 commit comments