You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As webpack + rspack already handle import.meta.url, I feel like it wouldn't be too much of a stretch to support these?
Currently in rspack:
import.meta.dirname is replaced by /* unsupported import.meta.dirname */ undefined
import.meta.filename is replaced by /* unsupported import.meta.filename */ undefined
import.meta.resolve is replaced by ({}).resolve
I'm not sure how webpack handles this today, but it might be worth aligning with the webpack team regardless? And even if we can't support these (in the short term or long term), should the built no error/warn if these are encountered?
What does the proposed API of configuration look like?
I guess maybe node.__filename and node.__dirname could impact these (see https://rspack.dev/config/node), or new options could be added (either generic node.filename and node.dirname properties that handle both CJS and ESM, or a new node.import property just for ESM)?
The text was updated successfully, but these errors were encountered:
What problem does this feature solve?
Node recently added support for the following (currently in RC status):
import.meta.dirname
(https://nodejs.org/api/esm.html#importmetadirname)import.meta.filename
(https://nodejs.org/api/esm.html#importmetafilename)import.meta.resolve
(https://nodejs.org/api/esm.html#importmetaresolvespecifier)As webpack + rspack already handle
import.meta.url
, I feel like it wouldn't be too much of a stretch to support these?Currently in rspack:
import.meta.dirname
is replaced by/* unsupported import.meta.dirname */ undefined
import.meta.filename
is replaced by/* unsupported import.meta.filename */ undefined
import.meta.resolve
is replaced by({}).resolve
I'm not sure how webpack handles this today, but it might be worth aligning with the webpack team regardless? And even if we can't support these (in the short term or long term), should the built no error/warn if these are encountered?
What does the proposed API of configuration look like?
I guess maybe
node.__filename
andnode.__dirname
could impact these (see https://rspack.dev/config/node), or new options could be added (either genericnode.filename
andnode.dirname
properties that handle both CJS and ESM, or a newnode.import
property just for ESM)?The text was updated successfully, but these errors were encountered: