0.0.1 • Published 4 years ago

ts-browser-eval v0.0.1

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
4 years ago

Overview

Typescript compiler in the browser generating output chunks using rollup

Installation

$ npm install typed-route

###Quick example:

// lazy import for code splitting (package size ~2.5 MB)
const compile = await import('ts-browser-eval');

const project = {
  'main.ts': 'import {ABC} from "./inner.ts";\nconsole.log(ABC.a)',
  'inner.ts': 'export enum ABC {a, b, c}',
};

const result = await compile(project, 'root/main.ts', {
  target: 'ES2017',
}, {
  format: 'iife',
  name: 'bundle',
});

console.log(result[0].code);
/*
(function () {
    'use strict';

    var ABC;
    (function (ABC) {
        ABC[ABC["a"] = 0] = "a";
        ABC[ABC["b"] = 1] = "b";
        ABC[ABC["c"] = 2] = "c";
    })(ABC || (ABC = {}));

    console.log(ABC.a);

}());
*/

Arguments

Return

Current issues

  • There're no type checks ☹