New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

esbuild-meta-into-html-script-src

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-meta-into-html-script-src

## Installation

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

esbuild-meta-into-html-script-src

Installation

npm install [-g|--save] esbuild-meta-into-html-script-src

then use on commandline (npx esbuild-meta-into-html-script-src ...) or in scripts of package.json to automate

Usage

esbuild-meta-into-html-script-src metaJsonPath srcHtmlPath desHtmlPath [srcPrefix [desPrefix]]
  • metaJsonPath: meta json file path generated by esbuild: https://esbuild.github.io/api/#metafile
  • srcHtmlPath: html template file path
  • desHtmlPath: result html path will be written to

srcPrefix and desPrefix: prefix to remove in meta json mapping, for example, entering srcPrefix: 'src/', desPrefix: 'dist/' will make:

'src/web.js': 'dist/web-NPBBEE7I.js'

become:

'web.js': 'web-NPBBEE7I.js'

Example

esbuild-meta-into-html-script-src meta.json src/index.html dist/index.html src/ dist/

Get entryPointMapping from generated html

window.ENTRY_POINTS_MAPPING = typeof window !== 'undefined' ? JSON.parse(
  document.head.querySelector('meta[name=entry-points-mapping]')?.content || '{}'
) : {}

Keywords

esbuild

FAQs

Package last updated on 22 Oct 2021

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