Closed lvqq closed 1 year ago
figured out a way to do this using esbuild's define
option and inject some code by peeking Vite's source code: https://github.com/vitejs/vite/blob/51ed05915ae1fcebacd5bcebca76559a2b8e4473/packages/vite/src/node/config.ts#L1013
:tada: This issue has been resolved in version 3.1.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I find bundle-require uses a custom esbuild plugin to handle path, source code is:
Here has a problem while a string including keywords like
__filename
,__dirname
orimport.meta.data
, the path in string is handled too. See the example intsup.config.ts
usingbanner
: https://github.com/egoist/tsup/issues/719.So maybe we need to add logic to exclude path in string. But regexp match seems hard to judge if the path reference is in string or not. Is there any quick way to fix this problem? AST may do, but it complicates the logic of the plugin.