Skip to content

motorcycle/compiler

Repository files navigation

@motorcycle/compiler

Get It

npm install --save @motorcycle/compiler
# or
yarn add @motorcycle/compiler

API

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)

About

Compile away dynamic parts of @motorcycle/run

Resources

License

Stars

Watchers

Forks

Packages

No packages published