Socket
Socket
Sign inDemoInstall

esbuild-plugin-define

Package Overview
Dependencies
24
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    esbuild-plugin-define

esbuild plugin to define global identifiers


Version published
Weekly downloads
2.3K
decreased by-13.32%
Maintainers
1
Install size
7.75 kB
Created
Weekly downloads
 

Readme

Source

esbuild-plugin-define

Build Status

Install

npm install esbuild-plugin-define -D

Usage

Add the plugin to your esbuild plugins.

Example esbuild.config.cjs file:

const { definePlugin } = require('esbuild-plugin-define');

module.exports = () => {
  const config = {
    bundle: true,
    sourcemap: true,
    platform: 'node',
    target: 'es2022',
    format: 'esm',
    outputFileExtension: '.mjs',
    define: {},
    concurrency: 4,
    watch: {
      pattern: ['./src/**'],
      ignore: ['dist', 'node_modules'],
    },
    plugins: [
      definePlugin({
        process: {
          env: {
            BUILD_TIMESTAMP: new Date().toISOString(),
          },
        },
      }),
    ],
  };

  return config;
};

Keywords

FAQs

Last updated on 19 Nov 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc