swc-project / swc-project/pkgs
__webpack_require__(...).context is not a function
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 86
- Forks
- 44
- Avg merge
- 3d 49m
- Merged PRs (30d)
- 1
Description
From https://github.com/swc-project/swc-loader/issues/64#issue-1335268930 by @callmeteus
I'm trying to port from babel-loader and ts-loader to swc-loader, but everytime
require.contextis called, it returns undefined.When printing the
requirevariable, it returns the following module:function webpackEmptyContext(req) { var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; } webpackEmptyContext.keys = () => ([]); webpackEmptyContext.resolve = webpackEmptyContext; webpackEmptyContext.id = 5102; module.exports = webpackEmptyContext;
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported require.context behavior while using swc-loader, then inspect the generated module shown in the report and compare it with the expected webpack context API. Done means require.context is available through swc-loader and the reported module-loading behavior works; no repository file or test is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- webpack
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100