esbuild-plugin-path-alias

    1.0.3 • Public • Published

    esbuild-plugin-path-alias

    A esbuild plugin to support path alias like resolve.alias in webpack config.

    Usage

    npm install -D esbuild-plugin-path-alias
    const esbuild = require('esbuild');
    const aliasPlugin = require('esbuild-plugin-path-alias');
    const path = require('path');
    
    esbuild.build({
      entryPoints: [path.resolve(__dirname, './app/app.jsx')],
      bundle: true,
      outdir: 'dist',
      external: ['react'],
      plugins: [
        aliasPlugin({
          // must be absolute path
          '@': path.resolve(__dirname, './app/component')
        })
      ],
      logLevel: 'debug'
    });

    See test for details.

    Install

    npm i esbuild-plugin-path-alias

    DownloadsWeekly Downloads

    162

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    4.47 kB

    Total Files

    7

    Last publish

    Collaborators

    • indooorsman