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

@craftamap/esbuild-plugin-html

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@craftamap/esbuild-plugin-html - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

19

lib/cjs/index.js

@@ -11,3 +11,2 @@ "use strict";

const lodash_template_1 = __importDefault(require("lodash.template"));
const urlcat_1 = __importDefault(require("urlcat"));
const defaultHtmlTemplate = `

@@ -95,2 +94,15 @@ <!DOCTYPE html>

}
// use the same joinWithPublicPath function as esbuild:
// https://github.com/evanw/esbuild/blob/a1ff9d144cdb8d50ea2fa79a1d11f43d5bd5e2d8/internal/bundler/bundler.go#L533
function joinWithPublicPath(publicPath, relPath) {
relPath = path_1.default.normalize(relPath);
if (!publicPath) {
publicPath = '.';
}
let slash = '/';
if (publicPath.endsWith('/')) {
slash = '';
}
return `${publicPath}${slash}${relPath}`;
}
function injectFiles(dom, assets, outDir, publicPath, htmlFileConfiguration) {

@@ -102,3 +114,3 @@ const document = dom.window.document;

if (publicPath) {
targetPath = (0, urlcat_1.default)(publicPath, path_1.default.relative(outDir, filepath));
targetPath = joinWithPublicPath(publicPath, path_1.default.relative(outDir, filepath));
}

@@ -186,2 +198,5 @@ else {

const out = path_1.default.join(outdir, htmlFileConfiguration.filename);
await fs_1.promises.mkdir(path_1.default.dirname(out), {
recursive: true,
});
await fs_1.promises.writeFile(out, dom.serialize());

@@ -188,0 +203,0 @@ const stat = await fs_1.promises.stat(out);

5

package.json
{
"name": "@craftamap/esbuild-plugin-html",
"version": "0.3.0",
"version": "0.3.1",
"main": "./lib/cjs/index.js",

@@ -37,5 +37,4 @@ "repository": {

"jsdom": "^17.0.0",
"lodash.template": "^4.5.0",
"urlcat": "^2.0.4"
"lodash.template": "^4.5.0"
}
}
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