Deprecated -- See TSBunch for the successor
A VERY simple bundler designed to bundle TypeScript without compiling it into JS (Multiple .ts -> Single .ts)
There are plenty of TypeScript bundlers out there but none that don't also compile TypeScript into regular JS. This bundler seeks to rectify that by providing a very simple way to concatenate multiple TypeScript modules into one TypeScript file.
The impetus behind this was to allow TypeScript projects composed of multiple modules to be uploaded to CodinGame (which only accepts single flat files) either by hand or by using the CodinGame Sync App WITHOUT converting those TypeScript files to JavaScript in the process.
Installing:
$ npm install --save-dev minipack_ts
- entryFilePath: String file path of the bundle entry file
- outputFilePath: (Optional) Name of output file, will default to
out.ts
- declarationsFile(s): (Optional) Single or array of string file paths to files which will placed at the top of the output file 'outside' of the bundle
Create a file with the following in it:
const minipack = require('minipack_ts');
minipack('path/to/entryFile.ts', 'path/to/outputFile.ts', 'path/to/declarationsFile.d.ts');
Finally run that file with:
$ node file.js
This bundler is VERY basic so only the following module expressions are supported:
import defaultExport from 'path'
import { export1 } from 'path'
import { export1, export2 } from 'path'
export default expression
export default function(){}
export let/var/const/enum name
export let/var/const/enum name = expression
This will also not resolve any circular dependencies.
npm run build
: applies Babelnpm run test
: runs all testsnpm run testWatch
: runs all tests in watch mode
- Use
tsconfig.json
for file import
- Example of usage can be found here
- Forked from minipack, originally created by Ronen Amiel
- Typescript dependency checking heavily inspired from detective-typescript
I'm available for freelance, contracts, and consulting both remotely and in the Hudson Valley, NY (USA) area. Some more about me and what I can do for you.
Feel free to drop me a message at:
hi [a+] zweisolutions {โ} com