Skip to content

fix: fallback to interpret only when configuration can't be load by dynamic import#4647

Merged
alexander-akait merged 12 commits intomainfrom
issue-4525
Feb 16, 2026
Merged

fix: fallback to interpret only when configuration can't be load by dynamic import#4647
alexander-akait merged 12 commits intomainfrom
issue-4525

Conversation

@alexander-akait
Copy link
Member

Summary

Trying to use import() firstly, then as a fallback require with interpret

What kind of change does this PR introduce?

fix

Did you add tests for your changes?

Existing

Does this PR introduce a breaking change?

Potential no, but you can faced with such message:

(node:499534) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///path/to/webpack.config.ts is not specified and it doesn't parse as CommonJS.
Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
To eliminate this warning, add "type": "module" to /home/alexander-akait/IdeaProjects/webpack-cli/package.json.
(Use `node --trace-warnings ...` to show where the warning was created)

it means:

  • You webpack.config.ts is in ESM, but your `type: "commonjs"``
  • You have babel/esbuild/etc to handle this configuration and before we load these configuration using require
  • But now you configuration was loaded by import and built-in typescript support

Nothing critical - just rename your configuration file to `mts``

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Doc site will need to be updated

@alexander-akait alexander-akait requested a review from a team as a code owner February 16, 2026 18:17
@alexander-akait alexander-akait changed the title fix: fallback to interpret only when configuration can't be load fix: fallback to interpret only when configuration can't be load by dynamic import Feb 16, 2026
@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.65%. Comparing base (abe64ab) to head (0eab614).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4647   +/-   ##
=======================================
  Coverage   95.65%   95.65%           
=======================================
  Files           2        2           
  Lines          23       23           
  Branches        4        4           
=======================================
  Hits           22       22           
  Misses          1        1           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update abe64ab...0eab614. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alexander-akait alexander-akait merged commit e7b71ed into main Feb 16, 2026
19 checks passed
@alexander-akait alexander-akait deleted the issue-4525 branch February 16, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant