1.0.4 • Published 8 months ago

esbuild-plugin-ts-to-json v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

A plugin for esbuild to transform a typescript file to JSON file

Description

This plugin use build points to transform a typescript file to JSON file. That's why I recommend using a dedicated build for this plugin. It takes the entryPoints and outputs into the outdir. There are also some esbuild options that must be set accordingly for the plugin to work as expected.

  bundle: true,
  write: false,
  format: "esm",

Why this plugin?

To unlock the use of custom functions, type definitions, or any other dynamic logic.

Installation

Add the package to your "devDependencies":

npm i -D esbuild-plugin-ts-to-json

Define an esbuild configuration:

import { build } from "esbuild";

await build({
  entryPoints: ["src/manifest.ts"],
  outdir: "build",
  bundle: true,
  write: false,
  format: "esm",
  plugins: [esbuildTsToJson()],
});
1.0.4

8 months ago

1.0.3

8 months ago