metalsmith-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

metalsmith-ts

A Metalsmith plugin for transpiling TypeScript files.

Install

yarn add -D metalsmith-ts

Usage

const metalsmith = require('metalsmith');
const markdown = require('@metalsmith/markdown');
const layouts = require('@metalsmith/layouts');
const typescript = require('metalsmith-ts');

metalsmith(__dirname)
    .metadata({
        sitename: 'My Site',
    })
    .source('src')
    .destination('build')
    .use(markdown())
    .use(
        typescript({
            outputDir: 'js/',
        })
    )
    .use(
        layouts({
            suppressNoFilesError: true,
        })
    )
    .build((err) => {
        if (err) throw err;
    });

Options

outputDir (Optional)

The directory (relative to destination) where files will end up.

transpileOptions (Optional)

Object passed to TypeScript's transpileModule() function. Click here for available options.

Notes

  • Only files ending in .ts will be processed.
  • Files outside the source directory are ignored.

Readme

Keywords

none

Package Sidebar

Install

npm i metalsmith-ts

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

8.75 kB

Total Files

14

Last publish

Collaborators

  • jegwastaken