@ts-to-json-schema/esbuild-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

@ts-to-json-schema/esbuild-plugin

ESBuild plugin for TypeScript to JSON Schema

Installation

npm install --save-dev typescript esbuild @ts-to-json-schema/esbuild-plugin @ts-to-json-schema/transform

Configuration

const esbuild = require('esbuild');
const { tsToJsonSchemaPlugin } = require('@ts-to-json-schema/esbuild-plugin');

esbuild.build({
  entryPoints: ['src/index.ts'],
  bundle: true,
  outfile: 'dist/index.js',
  plugins: [
    tsToJsonSchemaPlugin() // Add here
  ],
}).catch(() => process.exit(1));

Options

tsConfigFile

You can specify the path to the TypeScript configuration file.

tsToJsonSchemaPlugin({
  tsConfigFile: 'tsconfig.other.json' // Default: 'tsconfig.json'
})

tsx

You can enable parsing of TSX files.

tsToJsonSchemaPlugin({
  tsx: true // Default: false
})

Package Sidebar

Install

npm i @ts-to-json-schema/esbuild-plugin

Weekly Downloads

1

Version

1.2.3

License

MIT

Unpacked Size

7.26 kB

Total Files

6

Last publish

Collaborators

  • pedromdev