Experience-Monks / Experience-Monks/babel-plugin-static-fs

Doesn't like dynamic imports

Open
#8 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
35
Forks
11
PR merge metrics
No merged PRs in 30d

Description

Plugin is fine when using without dynamic `import`s in Webpack – using `chunkFilename`. However, as soon as you try to build it with dynamic `import`s I get:

```
ERROR in ./node_modules/pdfkit/js/document.js
Module build failed: Error: /node_modules/pdfkit/js/document.js: Could not statically evaluate how the fs module was required/imported.
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the dynamic import build in Webpack and inspect the failure reported for node_modules/pdfkit/js/document.js. Trace how the plugin handles fs imports in dynamically loaded modules. Done means the build completes without the static-evaluation error while preserving the existing non-dynamic import behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, javascript, webpack
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.