This package has been deprecated

Author message:

Deprecated, see https://github.com/Zweihander-Main/TSBunch for successor

minipack_ts

0.6.0 • Public • Published

Deprecated -- See TSBunch for the successor

📦 Minipack_TS

A VERY simple bundler designed to bundle TypeScript without compiling it into JS (Multiple .ts -> Single .ts)

Introduction

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.

Usage

Installing:

$ npm install --save-dev minipack_ts

minipack(entryFilePath, [outputFilePath], [declarationsFile(s)])

  • 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

Caveats

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.

Scripts

  • npm run build: applies Babel
  • npm run test: runs all tests
  • npm run testWatch: runs all tests in watch mode

Todo/Future Improvements

  • Use tsconfig.json for file import

Notes

Credits

Available for Hire

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

License

MIT

Package Sidebar

Install

npm i minipack_ts

Weekly Downloads

0

Version

0.6.0

License

MIT

Unpacked Size

12.6 kB

Total Files

5

Last publish

Collaborators

  • zweihander