├── .github ├── FUNDING.yml └── workflows │ ├── ci.yml │ └── release.yml ├── .gitignore ├── .npmrc ├── .vscode └── settings.json ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── eslint.config.js ├── package.json ├── pnpm-lock.yaml ├── pnpm-workspace.yaml ├── runtime-fixtures └── dummy.mts ├── src ├── detect.ts ├── import.ts ├── index.ts ├── loaders │ ├── jiti.ts │ └── tsx.ts └── types.ts ├── test ├── __snapshots__ │ └── detect.test.ts.snap ├── cts.test.ts ├── detect.test.ts ├── fixtures │ ├── basic │ │ ├── bar.mts │ │ └── foo.mts │ ├── cts │ │ ├── index.cts │ │ └── package.json │ ├── import-esm-dep │ │ └── index.ts │ ├── matrix.mjs │ ├── mixed │ │ ├── cjs.cts │ │ └── index.ts │ └── ts-const-enum │ │ ├── enum.ts │ │ └── index.ts ├── get-module-info.test.ts ├── matrix-output.txt └── run-matrix.mjs └── tsconfig.json /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [antfu] 2 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/.github/workflows/ci.yml -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/.github/workflows/release.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/.gitignore -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/.npmrc -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/.vscode/settings.json -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Please refer to https://github.com/antfu/contribute 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/README.md -------------------------------------------------------------------------------- /eslint.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/eslint.config.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/package.json -------------------------------------------------------------------------------- /pnpm-lock.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/pnpm-lock.yaml -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/pnpm-workspace.yaml -------------------------------------------------------------------------------- /runtime-fixtures/dummy.mts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/runtime-fixtures/dummy.mts -------------------------------------------------------------------------------- /src/detect.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/src/detect.ts -------------------------------------------------------------------------------- /src/import.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/src/import.ts -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/src/index.ts -------------------------------------------------------------------------------- /src/loaders/jiti.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/src/loaders/jiti.ts -------------------------------------------------------------------------------- /src/loaders/tsx.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/src/loaders/tsx.ts -------------------------------------------------------------------------------- /src/types.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/src/types.ts -------------------------------------------------------------------------------- /test/__snapshots__/detect.test.ts.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/test/__snapshots__/detect.test.ts.snap -------------------------------------------------------------------------------- /test/cts.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/test/cts.test.ts -------------------------------------------------------------------------------- /test/detect.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/test/detect.test.ts -------------------------------------------------------------------------------- /test/fixtures/basic/bar.mts: -------------------------------------------------------------------------------- 1 | export const bar = 'bar' 2 | -------------------------------------------------------------------------------- /test/fixtures/basic/foo.mts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/test/fixtures/basic/foo.mts -------------------------------------------------------------------------------- /test/fixtures/cts/index.cts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/test/fixtures/cts/index.cts -------------------------------------------------------------------------------- /test/fixtures/cts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "commonjs" 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/import-esm-dep/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/test/fixtures/import-esm-dep/index.ts -------------------------------------------------------------------------------- /test/fixtures/matrix.mjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/test/fixtures/matrix.mjs -------------------------------------------------------------------------------- /test/fixtures/mixed/cjs.cts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/test/fixtures/mixed/cjs.cts -------------------------------------------------------------------------------- /test/fixtures/mixed/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/test/fixtures/mixed/index.ts -------------------------------------------------------------------------------- /test/fixtures/ts-const-enum/enum.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/test/fixtures/ts-const-enum/enum.ts -------------------------------------------------------------------------------- /test/fixtures/ts-const-enum/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/test/fixtures/ts-const-enum/index.ts -------------------------------------------------------------------------------- /test/get-module-info.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/test/get-module-info.test.ts -------------------------------------------------------------------------------- /test/matrix-output.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/test/matrix-output.txt -------------------------------------------------------------------------------- /test/run-matrix.mjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/test/run-matrix.mjs -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu-collective/importx/HEAD/tsconfig.json --------------------------------------------------------------------------------