@mothepro/ts-module-shim
v0.0.3
Published
Extends the 'es-module-shim' module to support TypeScript files
Downloads
8
Readme
TS Module Shim
Extends the 'es-module-shim' module to support TypeScript files
This should really only be used for development purposes.
TypeScript compiler is large (8 Mb) and performance expensive.
How to Use
<!-- Include the usual es-module-shim. -->
<script type="module" src="//unpkg.com/[email protected]/dist/es-module-shims.min.js"></script>
<!-- Include typescript and this module -->
<script src="//unpkg.com/[email protected]/lib/typescript.js"></script>
<script type="module" src="//unpkg.com/@mothepro/ts-module-shim/dist/esm/index.js"></script>
<!-- Then include your typescript file as a shim -->
<script dev-only type="module-shim" src="index.ts"></script>
TODO
- Properly handle typescript file extnesions
- May need to use the
transpileOptions
field
- May need to use the
- Conditionally load Typescript
- Import Typescript compiler within this module.
- Require only one module to be leaded in the HTML
- Better source map suppoert
- Support custom tsconfig files
- Support the
extends
field used in some TSConfigs
- Support the
- Add tests