esbuild-plugin-path-alias
v1.0.7
Published
A esbuild plugin to support path alias like `resolve.alias` in webpack config.
Downloads
45,165
Maintainers
Readme
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.