Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chialab/esbuild-plugin-meta-url

Package Overview
Dependencies
Maintainers
2
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chialab/esbuild-plugin-meta-url

A file loader plugin for esbuild for constructed URLs using import metadata.

  • 0.17.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Esbuild Plugin Meta Url • A file loader plugin for esbuild for constructed URLs using import metadata.

NPM


How it works

Esbuild Plugin Meta Url looks for new URL('path/to/file.png', import.meta.url) in JavaScript and TypeScript files and instructs esbuild to copy referenced files. This is a standard version of the file loader.

// DONT ❌
import img from './logo.png';

// DO ✅
const img = new URL('./logo.png', import.meta.url).href;

Install

$ npm i @chialab/esbuild-plugin-meta-url -D
$ yarn add @chialab/esbuild-plugin-meta-url -D

Usage

import esbuild from 'esbuild';
import metaUrlPlugin from '@chialab/esbuild-plugin-meta-url';

await esbuild.build({
    plugins: [
        metaUrlPlugin(),
    ],
});

License

Esbuild Plugin Meta Url is released under the MIT license.

Keywords

FAQs

Package last updated on 16 Mar 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc