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 - npm Package Compare versions

Comparing version 0.16.0 to 0.16.1

34

lib/index.js

@@ -113,3 +113,3 @@ import path from 'path';

const { platform, format, sourcesContent, sourcemap } = build.initialOptions;
const { onTransform, isEmittedPath, emitFile, emitChunk, loaders: buildLoaders } = useRna(build);
const { onTransform, isEmittedPath, resolveLocallyFirst, emitFile, emitChunk, loaders: buildLoaders } = useRna(build);

@@ -167,28 +167,16 @@ const usePlainScript = platform === 'browser' && format !== 'esm';

const requestName = value.split('?')[0];
const candidates = [];
if (requestName.startsWith('./') || requestName.startsWith('../')) {
candidates.push(requestName);
} else {
candidates.push(`./${requestName}`, requestName);
}
const { path: resolvedPath, pluginData: localFile } = await resolveLocallyFirst(requestName, {
kind: 'dynamic-import',
importer: args.path,
namespace: 'file',
resolveDir: path.dirname(args.path),
pluginData: null,
});
while (candidates.length) {
const pathName = /** @type {string} */ (candidates.shift());
const { path: resolvedPath } = await build.resolve(pathName, {
kind: 'dynamic-import',
importer: args.path,
namespace: 'file',
resolveDir: path.dirname(args.path),
pluginData: null,
});
if (!resolvedPath) {
continue;
}
if (!pathName.startsWith('./') && !pathName.startsWith('../')) {
if (resolvedPath) {
if (!localFile) {
const location = getLocation(code, startToken.start);
warnings.push({
pluginName: 'meta-url',
text: `Resolving '${pathName}' as module is not a standard behavior and may be removed in a future relase of the plugin.`,
text: `Resolving '${requestName}' as module is not a standard behavior and may be removed in a future relase of the plugin.`,
location: {

@@ -195,0 +183,0 @@ file: args.path,

{
"name": "@chialab/esbuild-plugin-meta-url",
"type": "module",
"version": "0.16.0",
"version": "0.16.1",
"description": "A file loader plugin for esbuild for constructed URLs using import metadata.",

@@ -33,3 +33,3 @@ "main": "lib/index.js",

"dependencies": {
"@chialab/esbuild-rna": "^0.16.0",
"@chialab/esbuild-rna": "^0.16.1",
"@chialab/estransform": "^0.16.0",

@@ -36,0 +36,0 @@ "@chialab/node-resolve": "^0.16.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