8000 feat: use jiti for plugin loading by BioPhoton · Pull Request #1228 · code-pushup/cli · GitHub
[go: up one dir, main page]

Skip to content

feat: use jiti for plugin loading#1228

Draft
BioPhoton wants to merge 71 commits intomainfrom
feat/jiti-module-loading
Draft

feat: use jiti for plugin loading#1228
BioPhoton wants to merge 71 commits intomainfrom
feat/jiti-module-loading

Conversation

@BioPhoton
Copy link
Collaborator
@BioPhoton BioPhoton commented Jan 21, 2026

Supportive PRs:

Closes #1226

This PR includes switches from bundleRequire to jiti. It includes:

  • jiti wrapper code to resolve TS config paths and forward to jiti
  • importModule got refactored to use jiti

Errors:

  • Problem: Access of window.document through 'axe-core' import
    Reproduction: node --input-type=module -e "import('jiti').then(j=>j.default()( 'axe-core'))"
    Error:
    /node_modules/axe-core/axe.js:14
      var document = window.document;
                            ^
    TypeError: Cannot read properties of undefined (reading 'document')
        at axeFunction (/cli/node_modules/axe-core/axe.js:14:25)
        at /cli/node_modules/axe-core/axe.js:32979:3
        at eval_evalModule (/cli/node_modules/jiti/dist/jiti.cjs:1:196325)
        at jitiRequire (/cli/node_modules/jiti/dist/jiti.cjs:1:190233)
        at /cli/node_modules/jiti/dist/jiti.cjs:1:199352
        at file:///cli/[eval1]:1:35
    
    Node.js v24.1.0
    Issues: axe.setup should set globals dequelabs/axe-core#3962
    Preliminalr fix: b7109fb

The following is here just to make it working and will get refactored if the PR is interesting:

  • polyfill for axe (access document as sinde effect)
  • cyclic eslint imports

Related: https://github.com/push-based/ts-jiti