Registry /
devops / esbuild-plugin-alias-path
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–223 runs
build_error
glibcnode 18–223 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
aliasPath
✓ import { aliasPath } from 'esbuild-plugin-alias-path'
✗ const aliasPath = require('esbuild-plugin-alias-path')
ESM-only package; CommonJS require will fail. Use dynamic import if needed.
aliasPath (default)
✓ import aliasPath from 'esbuild-plugin-alias-path'
✗ import { aliasPath } from 'esbuild-plugin-alias-path'
Package exports both named and default export; both work, but default import is an alias for the named export.
AliasOption
✓ import type { AliasOption } from 'esbuild-plugin-alias-path'
Type import available for TypeScript users to type the options object.
Shows how to configure aliasPath with both exact and glob alias patterns in an esbuild build script.
import { build } from 'esbuild';
import { aliasPath } from 'esbuild-plugin-alias-path';
(async () => {
const result = await build({
entryPoints: ['./src/main.ts'],
bundle: true,
outfile: './dist/main.js',
plugins: [
aliasPath({
alias: {
'@utils': './src/utils/index.ts',
'@components/*': './src/components',
},
}),
],
});
})();
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/esbuild-plugin-alias-path/dist/index.mjs not supported
Attempting to require an ESM-only package in a CommonJS context.
fixChange to: const { aliasPath } = await import('esbuild-plugin-alias-path'); TypeError: aliasPath is not a function
Using named import incorrectly when the package only exports default.
fixImport as: import aliasPath from 'esbuild-plugin-alias-path';
Audit
Dependencies
esbuildrequiredpeer dependency required to run the plugin