Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
add support for deep re-exports
Browse files Browse the repository at this point in the history
  • Loading branch information
cawa-93 committed Jan 1, 2024
1 parent 29714ec commit 414ee6f
Show file tree
Hide file tree
Showing 13 changed files with 188 additions and 107 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ jobs:
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
working-directory: playground

- run: npm run build:main
working-directory: playground
- run: npm run build:preload
working-directory: playground
- run: npm run build:renderer
working-directory: playground

- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm test
working-directory: playground
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,23 @@ import {foo} from '#preload'
const foo = window.__electron_preload_foo
```

## Limitation
Currently, only the input file is analyzed. This means that you cannot re-export anything from other modules without specifying the names
## Supports all export declaration

```ts
export * from 'file' // ❌ Will not work
// Export named declaration
export const prop = 1
export function method() {}

// Named Re-export
export {prop} from 'file'
export {prop as propAlias} from 'file'

// Export all declaration
export * from 'file'
export * as props from 'file'

export * as props from 'file' //
export {prop} from 'file' //
export {prop as propAlias} from 'file' //
// Default exports
export default 'foo'
```

## Configuration
Expand Down
Loading

0 comments on commit 414ee6f

Please sign in to comment.