Socket
Book a DemoInstallSign in
Socket

@syndicate-lang/esbuild-plugin

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syndicate-lang/esbuild-plugin

Syndicate/JS JavaScript and TypeScript esbuild plugin

latest
npmnpm
Version
1.0.0-rc.2
Version published
Maintainers
1
Created
Source

esbuild plugin for Syndicate/JS

import esbuild from 'esbuild';
import { syndicatePlugin } from '@syndicate-lang/esbuild-plugin';

...

esbuild.build({
  ...
  plugins: [..., syndicatePlugin(), ...],
  ...
});

...

The syndicatePlugin function takes an optional options object. It may include properties:

  • module, optional, drawn from "es6" (the default), "require", "global", or "none": controls how to get hold of an instance of the @syndicate-lang/core module. If es6, uses import; if require, uses require; if global, uses a global variable (useful for browser contexts); if none, does no imports, so some other provision will have to be made to ensure __SYNDICATE__ is bound to a module instance for the output code.

  • runtime, optional string: defaults to "@syndicate-lang/core". For module of es6 or require, names the module to import/require, respectively; for module of global, an expression to yield a module instance.

    For example, in a browser, using a CDN to retrieve a dist/syndicate.js script from the @syndicate-lang/core package produces a Syndicate global variable, so you could set module to global and runtime to Syndicate or window.Syndicate etc.

  • include, exclude: both optional arrays of strings. By default, include is ["**/*.{js,ts}"] and exclude is ["node_modules/**"]. Each time esbuild considers a module path, the Syndicate plugin first checks to see if it matches some glob in include (using outmatch). If not, the plugin delegates to esbuild's default handler. Otherwise, it checks to see if it matches some glob in exclude. If so, again it delegates to esbuild. Otherwise, it runs the Syndicate compiler on the module source code and hands that off to esbuild.

FAQs

Package last updated on 18 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts