resolves ESM paths relative to a given path
ISC License
Bot releases are hidden (Show)
Published by iambumblehead 8 months ago
Essentially, this release enables resolvewithplus to resolve the following esm export
{
"exports": {
"./*": {
"require": "./*.js",
"import": "./*.js"
}
}
}
Full list of changes,
Published by iambumblehead 9 months ago
resolve nested exports defined on named-properties with wildcards, eg exports: { './*': { default: './src/*/index.js' } }
resolves this issue at esmock
Published by iambumblehead 12 months ago
resolve full path from package.json "main", "browser" and "module" definitions. resolves this issue at esmock.
Published by iambumblehead 12 months ago
remove unused condition and resolved error where fileurl path was not correctly resolved for package.json "main", "browser" and "module" definitions
Published by iambumblehead almost 1 year ago
when user-defined priority list includes "import" return packagejson.module before packagejson.main
support user-defined priority list when resolving nested export expressions
Published by iambumblehead about 1 year ago
resolve error preventing module resolution. There is a condition that alters lookup paths for the situation when resolvewithplus is being developed and tested from inside another package's node_modules. The condition caused lookup errors. The condition was changed and a unit-test added
Published by iambumblehead about 1 year ago
remove un-necessary sorting to provide faster lookups
Published by iambumblehead about 1 year ago
use package type to determine lookup: 'import' or 'require'
(wiki is updated with details)
Published by iambumblehead about 1 year ago
With this release resolvewithplus
supports optional isbrowser
, istypescript
and isimport
fields and when one of these is specified the resolver prioritizes browser-exported files, typecript and module files. By default, isimport
is true
resolvewithplus('react-dom/server', '/resolvewith/test/', {
isbrowser: true
}) // 'file:///resolvewith/node_modules/react-dom/server.browser.js'
resolvewithplus
now also supports an advanced priority
option. When a package.json is parsed, a default priority
list determines the priority of named-exports in this order: browser
(if isbrowser
), then import
then node
then default
. Define a custom priority
list to specify a custom ordering. If you are using nodejs, this is probably not needed,
resolvewithplus('react-dom/server', '/resolvewith/test/', {
priority: ['deno', 'default']
}) // 'file:///resolvewith/node_modules/react-dom/server.deno.js'
resolvewithplus('react-dom/server', '/resolvewith/test/', {
priority: ['browser', 'default']
}) // 'file:///resolvewith/node_modules/react-dom/server.browser.js'
changelog:
Published by iambumblehead about 1 year ago
this PR changes the location of isTypescript detection to occur in one place that is more widely used so that it can be engaged more frequently to improve typescript resolution.
Published by iambumblehead about 1 year ago
When the resolver detects a typescript parent it can apply typescript conditions to resolve the moduleId. New conditions can be added for typescript situations as needed, this new behaviour is a starting point,
Published by iambumblehead over 1 year ago
v2.0.2 use node v20 ci, increment dependencies
Published by iambumblehead almost 2 years ago
resolve windows modules with correct drive letter using patch from @mshima
Published by iambumblehead almost 2 years ago
return encoded url same as import.meta.resolve ,
Published by iambumblehead about 2 years ago
Add test and changes to support import.meta.url parent. While exploring changes at esmock, it was discovered that esmock slightly modifies import.meta.url from the callee before passing along when calling resolvewithplus,
resolvewithplus('../../index.js', import.meta.url)
Published by iambumblehead about 2 years ago
minified resolvewithplus.js is 50% smaller and total install size becomes 5.78kB, from 6.79kB
Published by iambumblehead about 2 years ago
Returning fileurl-formatted paths allows esmock to be simplified, where esmock previously needed to detect and convert resolvewithplus paths to fileurl-formatted paths. Returning fileurl-formatted paths also makes resolvewithplus more interchangeable with import.meta.resolve, which also returns fileurl-formatted paths,
Published by iambumblehead about 2 years ago
completed esm pattern parsing (big improvement)
Published by iambumblehead about 2 years ago
resolve "pg" package's cjs "main": "./lib"
Published by iambumblehead about 2 years ago
support win32 drive-style module-path