Entry point cannot be marked as external when making node_modules external for node, on Windows.
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
When I run build I get "The entry point cannot be marked as external" with this being the resolver plugin, only on windows machines, it works fine for wsl and posix.
```ts
{
name: 'make-all-packages-external',
setup(build) {
// iife files should be fully bundled.
if (build.initialOptions.outExtension?.['.js'].startsWith('.iife.js')) {
const filter = /^vue$/
build.onResolve({ filter }, () => {
return {
path: 'Vue',
external: true,
}
})
} else {
// It fails here!
const filter = /^[^.\/]|^\.[^.\/]|^\.\.[^\/]/ // Must not start with "/" or "./" or "../"
build.onResolve({ filter }, args => ({ path: args.path, external: true }))
}
},
},
```
Contributor guide
Research direction
Start by reproducing the supplied configuration on Windows and compare it with WSL or a POSIX system. Inspect the resolver plugin's build.onResolve handler and its path filter; done means node_modules dependencies can be marked external without the entry-point error while the existing IIFE behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100