We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
fec-builder
With tools like vercel/ncc
The text was updated successfully, but these errors were encountered:
简单尝试了下,目前主要的障碍在:
依赖 __dirname / __filename 的代码(如读取 preset config 的逻辑)会行为不正确(代码被 bundle 了)
__dirname
__filename
可以考虑通过获取 package (builder) root,然后往 package root 后边拼路径的方式来定位目标资源(如 preset config)
获取 package root 可以通过从当前文件路径向上找,直到找到最近的、包含 package.json 文件的路径来实现;不过需要注意,ncc 构建出的 dist/ 目录中也是有 package.json 文件的,因此这个做法会有问题
package.json
dist/
依赖 require.resolve 获取某个依赖(如 webpack loader 或 babel preset)的绝对路径的逻辑会不正确(依赖被 bundle 了)
require.resolve
考虑把这些依赖加到 ncc externals 里(跟着 builder 一起被安装);或者放到特定的目录里,通过拼接该特定目录来代替 require.resolve 逻辑
externals
依赖中存在类似 1 / 2 的逻辑
Sorry, something went wrong.
nighca
No branches or pull requests
With tools like vercel/ncc
The text was updated successfully, but these errors were encountered: