-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
leverage import.meta.resolve
to support import maps generation and accurate node_modules resolution when building
#684
Comments
require.resolve
to support building of the import maprequire.resolve
) to support building of the import map
require.resolve
) to support building of the import mapimport.meta.resolve
) to support building of the import map
import.meta.resolve
) to support building of the import mapimport.meta.resolve
to support building of the import map during development
So far this is working nice, but seeing a minor issue regarding a package that has an empty |
Looks like this issue may help things in terms of getting to a package root, but will probably have to |
import.meta.resolve
to support building of the import map during developmentimport.meta.resolve
to support building import maps during development
import.meta.resolve
to support building import maps during developmentimport.meta.resolve
to support import maps generation during development
import.meta.resolve
to support import maps generation during developmentimport.meta.resolve
to support import maps generation and accurate node_modules resolution during development
import.meta.resolve
to support import maps generation and accurate node_modules resolution during developmentimport.meta.resolve
to support import maps generation and accurate node_modules resolution when building
Type of Change
Summary
Coming out #674 for #570 which lets NodeJS do node_modules resolution for us by using
require.resolve
, one take away was that once NodeJS supportsimport.meta.resolve
, we can use that instead.Details
In plugin-node-modules, we have a couple functions that are doing the work of finding entry points and building up an import map for the user, primarily for development purposes.
getPackageEntryPoint
- as the name implies, it uses package.json to find the right entry point, but now that we are able to get this fromrequire.resolve
, do we sill need this at all?walkModule
- given an entry point, this walks through all theimport
andexport
statements to add to the overallimportMap
. I wonder though ifexport
maps invalidates the need for this? In theory, wouldn't dependencies in package.json /main
orexports
fields be able to provide all the information we need?In addition, we might not want to be hardcoding
process.cwd()
inwalkPackageJson
https://github.com/ProjectEvergreen/greenwood/blob/master/packages/cli/src/plugins/resource/plugin-node-modules.js#L110
The text was updated successfully, but these errors were encountered: