🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

esbuild-plugin-file-path-extensions

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugin-file-path-extensions - npm Package Compare versions

Comparing version

to
2.1.1-next.89d28f7.0

21

dist/index.js

@@ -1,2 +0,2 @@

import { stat } from 'node:fs/promises';
import { stat, readFile } from 'node:fs/promises';
import { join, extname } from 'node:path';

@@ -36,2 +36,16 @@

__name(isBuiltin, "isBuiltin");
async function isDefinedDependency(path) {
try {
const packageJsonPath = join(process.cwd(), "package.json");
const packageJson = JSON.parse(await readFile(packageJsonPath, { encoding: "utf-8" }));
const { dependencies, devDependencies, peerDependencies } = packageJson;
const dependenciesExist = Object.keys(dependencies ?? {}).some((dep) => dep === path);
const devDependenciesExist = Object.keys(devDependencies ?? {}).some((dep) => dep === path);
const peerDependenciesExist = Object.keys(peerDependencies ?? {}).some((dep) => dep === path);
return dependenciesExist || devDependenciesExist || peerDependenciesExist;
} catch (error) {
return false;
}
}
__name(isDefinedDependency, "isDefinedDependency");
async function getIsEsm(build, options) {

@@ -98,3 +112,4 @@ if (typeof options.esm === "undefined") {

const pathIsBuiltin = build.initialOptions.platform === "node" && await isBuiltin(args.path);
if (!pathAlreadyHasExt && !pathIsBuiltin) {
const pathIsDependency = build.initialOptions.platform === "node" && await isDefinedDependency(args.path);
if (!pathAlreadyHasExt && !pathIsBuiltin && !pathIsDependency) {
let { path } = args;

@@ -129,3 +144,3 @@ if (await isDirectory(args.resolveDir, path)) {

}, "esbuildPluginFilePathExtensions");
var version = "2.1.0";
var version = "2.1.1-next.89d28f7.0";

@@ -132,0 +147,0 @@ export { esbuildPluginFilePathExtensions, version };

10

package.json
{
"name": "esbuild-plugin-file-path-extensions",
"version": "2.1.0",
"version": "2.1.1-next.89d28f7.0",
"description": "An esbuild plugin to automatically insert file extensions in your built JavaScript files based on the specified target",

@@ -39,7 +39,7 @@ "main": "dist/index.cjs",

"@sapphire/ts-config": "^5.0.1",
"@types/node": "^20.12.11",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@types/node": "^20.12.12",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"cz-conventional-changelog": "^3.3.0",
"esbuild": "^0.21.1",
"esbuild": "^0.21.3",
"esbuild-plugin-version-injector": "^1.2.1",

@@ -46,0 +46,0 @@ "eslint": "^8.57.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet