@chialab/esbuild-plugin-meta-url
Advanced tools
Comparing version 0.15.40 to 0.16.0
import path from 'path'; | ||
import { isUrl } from '@chialab/node-resolve'; | ||
import { appendSearchParam, getSearchParam, isUrl } from '@chialab/node-resolve'; | ||
import { parse, walk, getIdentifierValue, getBlock, getLocation, TokenType } from '@chialab/estransform'; | ||
@@ -155,3 +155,4 @@ import { useRna } from '@chialab/esbuild-rna'; | ||
if (isEmittedPath(value)) { | ||
const id = getSearchParam(value, 'hash'); | ||
if (id && isEmittedPath(id)) { | ||
return; | ||
@@ -210,11 +211,13 @@ } | ||
if (isChunk) { | ||
entryPoint = (await emitChunk({ entryPoint: resolvedPath })).path; | ||
const chunk = await emitChunk({ path: resolvedPath }); | ||
entryPoint = appendSearchParam(chunk.path, 'hash', chunk.id); | ||
} else { | ||
entryPoint = (await emitFile(resolvedPath)).path; | ||
const file = await emitFile(resolvedPath); | ||
entryPoint = appendSearchParam(file.path, 'hash', file.id); | ||
} | ||
} else { | ||
entryPoint = `./${path.relative(path.dirname(args.path), resolvedPath)}`; | ||
entryPoint = path.relative(path.dirname(args.path), resolvedPath); | ||
} | ||
helpers.overwrite(startToken.start, endToken.end, `new URL('${entryPoint}', ${baseUrl})`); | ||
helpers.overwrite(startToken.start, endToken.end, `new URL('./${entryPoint}', ${baseUrl})`); | ||
@@ -221,0 +224,0 @@ return; |
{ | ||
"name": "@chialab/esbuild-plugin-meta-url", | ||
"type": "module", | ||
"version": "0.15.40", | ||
"version": "0.16.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.15.39", | ||
"@chialab/estransform": "^0.15.28", | ||
"@chialab/node-resolve": "^0.15.28" | ||
"@chialab/esbuild-rna": "^0.16.0", | ||
"@chialab/estransform": "^0.16.0", | ||
"@chialab/node-resolve": "^0.16.0" | ||
}, | ||
@@ -38,0 +38,0 @@ "devDependencies": { |
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
14165
247
+ Added@chialab/esbuild-rna@0.16.5(transitive)
+ Added@chialab/estransform@0.16.2(transitive)
+ Added@chialab/node-resolve@0.16.1(transitive)
- Removed@chialab/esbuild-rna@0.15.40(transitive)
- Removed@chialab/estransform@0.15.28(transitive)
- Removed@chialab/node-resolve@0.15.28(transitive)
Updated@chialab/esbuild-rna@^0.16.0
Updated@chialab/estransform@^0.16.0