Skip to content

Commit

Permalink
Use eager import to include client modules (vercel#35979)
Browse files Browse the repository at this point in the history
Eager import does almost the same thing as `require()` but it instead also supports loading an ES module.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
  • Loading branch information
shuding authored Apr 8, 2022
1 parent 5feb400 commit d8623bb
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,12 @@ export default async function transformSource(
__webpack_require__,
_: () => {
${imports
.map((importSource) => `require('${importSource}');`)
.map(
(importSource) =>
`import(/* webpackMode: "eager" */ ${JSON.stringify(
importSource
)});`
)
.join('\n')}
},
server: ${isServerExt ? 'true' : 'false'}
Expand Down

0 comments on commit d8623bb

Please sign in to comment.