
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
esbuild-auto-path-plugin
Advanced tools
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.
The npm package esbuild-auto-path-plugin receives a total of 191 weekly downloads. As such, esbuild-auto-path-plugin popularity was classified as not popular.
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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.