Package Exports
- jiti
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jiti) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
jiti
Just-in-time compiler for typescript and esm files for CommonJS environments.
Features
- Stable typescript and esm syntax support (currently using babel)
- Provide sync interface to replace
require()
andesm()
- Super slim and zero dependency (~1M install size)
- Syntax detect to avoid extra transform
- CommonJS cache integration
Usage
const jiti = require('jiti')(__filename)
jiti('./path/to/file.ts')
Development
- Clone Repo
- Run
yarn
- Run
yarn build
- Run
yarn dev
- Run
node ./test/jiti.js
Roadmap
- Basic working
- Syntax detect and fallback to CJS require
- Improve project build system
- Sourcemap support
- File system cache
- Add tests
- Configurable transform (esbuild)
License
MIT