-
Notifications
You must be signed in to change notification settings - Fork 146
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
Opposite of ignore? #283
Comments
No, there is no option for that. I recommend adding a line like |
What about exposing the special cases functionality? I think being able to add things to that list when calling |
Can you share your use case? Are you publishing a package to npm that you want to work with |
I've built a plugin that uses NFT for bundling dependencies for Serverless Framework: https://github.com/neofinancial/serverless-plugin-neo While upgrading Serverless projects to use this new plugin I've come across a couple packages that don't get traced properly. I've ended up building my own version of NFT's special cases functionality here: https://github.com/neofinancial/serverless-plugin-neo/blob/master/src/lib/dependencies.ts What would be ideal is if I could just do something like this: const tracedDependencies = await nodeFileTrace(entrypoints, {
specialCases: {
'datadog-lambda-js' ({ id, emitAssetDirectory }) {
if (id.endsWith('datadog-lambda-js/dist/index.js')) {
emitAssetDirectory(resolve(dirname(id), 'runtime/'));
}
},
}
}); |
How about adding that special case to nft? |
I can definitely do that. I've already added two in my project and I see a number of open issues about other cases which is why I suggested making that list extensible. I'm happy to just make a PR for these cases though. |
A PR with an integration test would be welcome, thanks! (see #262 for an example) |
Is there a way to specify a file or glob that should always be included in the traced file list? Basically the opposite of the
ignore
setting? I tried using a negated glob inignore
but that didn't give me the results I wanted and I don't see anything else in the docs that seems like what I need.The text was updated successfully, but these errors were encountered: