npm install --save @motorcycle/compiler
# or
yarn add @motorcycle/compiler
compile(filePath: string): string
Takes the entry file to your Motorcycle run function away using
type information from the TypeScript compiler.
Example:
import { compile } from '@motorcycle/compiler'
import * as fs from 'fs'
const filePath = './src/bootstrap.ts'
const { code, sourceMap } = compile(filePath)
fs.writeFileSync(filePath, code)
fs.wrtieFileSync(`${filePath}.map`, sourceMap)