Skip to content

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

License

Notifications You must be signed in to change notification settings

indooorsman/esbuild-plugin-path-alias

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esbuild-plugin-path-alias

npm version test

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks