@chialab/esbuild-plugin-meta-url
Advanced tools
Comparing version 0.15.38 to 0.15.39
@@ -113,3 +113,3 @@ import path from 'path'; | ||
const { platform, format, sourcesContent, sourcemap } = build.initialOptions; | ||
const { onTransform, emitFile, emitChunk, loaders: buildLoaders } = useRna(build); | ||
const { onTransform, isEmittedPath, emitFile, emitChunk, loaders: buildLoaders } = useRna(build); | ||
@@ -156,2 +156,6 @@ const usePlainScript = platform === 'browser' && format !== 'esm'; | ||
if (isEmittedPath(value)) { | ||
return; | ||
} | ||
const tokens = getBlock(processor, TokenType.parenL, TokenType.parenR); | ||
@@ -203,11 +207,12 @@ const startToken = tokens[0]; | ||
const entryLoader = buildLoaders[path.extname(resolvedPath)] || 'file'; | ||
const isChunk = entryLoader !== 'file' && entryLoader !== 'json'; | ||
let entryPoint; | ||
if (emit) { | ||
if (entryLoader !== 'file' && entryLoader !== 'json') { | ||
if (isChunk) { | ||
entryPoint = (await emitChunk({ entryPoint: resolvedPath })).path; | ||
} else { | ||
entryPoint = appendSearchParam((await emitFile(resolvedPath)).path, 'emit', 'file'); | ||
entryPoint = (await emitFile(resolvedPath)).path; | ||
} | ||
} else { | ||
entryPoint = `./${path.relative(path.dirname(args.path), resolvedPath)}`; | ||
entryPoint = appendSearchParam(`./${path.relative(path.dirname(args.path), resolvedPath)}`, 'emit', isChunk ? 'chunk' : 'file'); | ||
} | ||
@@ -223,3 +228,3 @@ | ||
pluginName: 'meta-url', | ||
text: `Unable to resolve '${requestName}' reference.`, | ||
text: `Unable to resolve '${requestName}' file.`, | ||
location: { | ||
@@ -226,0 +231,0 @@ file: args.path, |
{ | ||
"name": "@chialab/esbuild-plugin-meta-url", | ||
"type": "module", | ||
"version": "0.15.38", | ||
"version": "0.15.39", | ||
"description": "A file loader plugin for esbuild for constructed URLs using import metadata.", | ||
@@ -23,3 +23,3 @@ "main": "lib/index.js", | ||
"scripts": { | ||
"types": "rimraf 'types' '*.tsbuildinfo' && tsc --declaration --emitDeclarationOnly --declarationDir ./types", | ||
"types": "rimraf './{types,*.tsbuildinfo}' && tsc -b", | ||
"prepack": "yarn types" | ||
@@ -38,3 +38,3 @@ }, | ||
"dependencies": { | ||
"@chialab/esbuild-rna": "^0.15.37", | ||
"@chialab/esbuild-rna": "^0.15.38", | ||
"@chialab/estransform": "^0.15.28", | ||
@@ -41,0 +41,0 @@ "@chialab/node-resolve": "^0.15.28" |
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
14104
244