0.3.1 • Published 3 months ago

@liip/esbuild-plugin-ast v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

esbuild-plugin-ast

A plugin to generate an AST representation of your .js files. The plugin use Acorn to produce an estree compliant AST object. You can then apply transformations by providing a visitor object.

Installation

npm i -D @liip/esbuild-plugin-ast

Usage

import { astParser } from '@liip/esbuild-plugin-ast';

...

await esbuild.context({
  ...
  plugins: [astParser(options)],
  ...
});

...

Options

You can configure the way the plugin works by setting different options.

interface AstParserOptions {
  dependencies?: string[];
  visitor: ESTraverse.Visitor;
}

dependencies

An array of node module dependencies on which this plugin should also operate.

visitor

An ESTraverse.Visitor object used to apply AST transformation. Check the Estraverse documentation form more information on the available API.

0.3.1

3 months ago

0.3.0

7 months ago

0.2.0

7 months ago

0.1.1

10 months ago

0.1.0

10 months ago