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.17.5 to 0.18.0-alpha.0

25

lib/index.js

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

import { parse, walk, getIdentifierValue, getBlock, getLocation, TokenType } from '@chialab/estransform';
import { Build, useRna } from '@chialab/esbuild-rna';
import { useRna } from '@chialab/esbuild-rna';

@@ -169,3 +169,3 @@ /**

const requestName = value.split('?')[0];
const { path: resolvedPath, pluginData } = await build.resolveLocallyFirst(requestName, {
const { path: resolvedPath } = await build.resolve(`./${requestName}`, {
kind: 'dynamic-import',

@@ -179,21 +179,2 @@ importer: args.path,

if (resolvedPath) {
if (pluginData !== Build.RESOLVED_AS_FILE) {
const location = getLocation(code, startToken.start);
warnings.push({
id: 'import-meta-module-resolution',
pluginName: 'meta-url',
text: `Resolving '${requestName}' as module is not a standard behavior and may be removed in a future relase of the plugin.`,
location: {
file: args.path,
namespace: args.namespace,
...location,
length: endToken.end - startToken.start,
lineText: code.split('\n')[location.line - 1],
suggestion: 'Externalize module import using a JS proxy file.',
},
notes: [],
detail: '',
});
}
const entryLoader = build.getLoader(resolvedPath) || 'file';

@@ -247,3 +228,3 @@ const isChunk = entryLoader !== 'file' && entryLoader !== 'json';

helpers.overwrite(startToken.start, endToken.end, `new URL('./${entryPoint}', ${baseUrl})`);
helpers.overwrite(startToken.start, endToken.end, `new URL('./${entryPoint.split(path.sep).join('/')}', ${baseUrl})`);
return;

@@ -250,0 +231,0 @@ }

10

package.json
{
"name": "@chialab/esbuild-plugin-meta-url",
"type": "module",
"version": "0.17.5",
"version": "0.18.0-alpha.0",
"description": "A file loader plugin for esbuild for constructed URLs using import metadata.",

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

"dependencies": {
"@chialab/esbuild-rna": "^0.17.6",
"@chialab/estransform": "^0.17.1",
"@chialab/node-resolve": "^0.17.0",
"@chialab/esbuild-rna": "^0.18.0-alpha.0",
"@chialab/estransform": "^0.18.0-alpha.0",
"@chialab/node-resolve": "^0.18.0-alpha.0",
"mime-types": "^2.1.35"

@@ -41,5 +41,5 @@ },

"@types/mime-types": "^2.1.1",
"esbuild": "^0.15.0",
"esbuild": "^0.17.0",
"typescript": "^4.3.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