
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
esbuild-auto-path-plugin
Advanced tools
Plugin for transforming bundles to use an auto path for assets.
esbuild-auto-path-pluginA plugin for esbuild to allow referencing files relative to the path of the JavaSCript. This can be useful to work in a micro frontend setup where the individual files of one micro frontend are served from a different path than the other micro frontends, i.e., no common public path can be determined.
Install the plugin:
npm i esbuild-auto-path-plugin --save-dev
Now in your esbuild configuration file you can do:
const { build } = require('esbuild');
const { autoPathPlugin } = require('esbuild-auto-path-plugin');
build({
// ...
plugins: [autoPathPlugin()],
});
At this point you can reference an asset file (e.g., .jpg) in any file, e.g., in a TypeScript asset
import someImage from './my.jpg';
The reference to the generated asset file will be done via the automatically (i.e., at runtime) determined path.
This plugin takes all extensions mapped to the file type in your esbuild configuration. However, you can also use the plugin to generate you this list of files. By default (i.e., if you don't specify any option and have not introduced any custom loader mapping) the following extensions will be mapped:
.png.svg.jpg.jpeg.webp.mp4.mp3.ogg.wav.ogv.wasm.gifTo override this list you can just pass in the extensions like this:
const { build } = require('esbuild');
const { autoPathPlugin } = require('esbuild-auto-path-plugin');
build({
plugins: [autoPathPlugin({
defaultExtensions: [".png", ".mov", ".woff"]
})],
});
This plugin is released using the MIT license. For more information see the LICENSE file.
FAQs
Plugin for transforming bundles to use an auto path for assets.
We found that esbuild-auto-path-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.