@chialab/esbuild-plugin-meta-url
Advanced tools
Comparing version 0.17.5 to 0.18.0-alpha.0
@@ -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 @@ } |
{ | ||
"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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14526
253
+ Added@chialab/esbuild-rna@0.18.2(transitive)
+ Added@chialab/estransform@0.18.1(transitive)
+ Added@chialab/node-resolve@0.18.0(transitive)
- Removed@chialab/esbuild-rna@0.17.8(transitive)
- Removed@chialab/estransform@0.17.5(transitive)
- Removed@chialab/node-resolve@0.17.1(transitive)