Giter Club home page Giter Club logo

minipack_ts's Introduction

๐Ÿ“ฆ 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

minipack_ts's People

Contributors

chinanf-boy avatar hg-pyun avatar ranyitz avatar rkrupinski avatar ronami avatar roymiloh avatar zweihander-main avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.