Exclude .js files from Panini's data processing

I have source files in my project organized per-component instead of per-filetype, like so:


Is there a way to exclude the .js file from being captured in Panini’s loadData method? It’s not intended to be used as handlebars data, and I’m getting a build error when Panini loads javascript dependencies in that file that aren’t intended to be loaded during the handlebars processing.

I’m able to work around this by separating the .json file into its own directory and passing that directory to Panini, but I’d like to avoid breaking up the above structure if possible.

Duplicate of https://github.com/foundation/panini/issues/218

Please do not cross post. I’ll close the issue so we have only one discussion open.

1 Like

Copied from the GitHub issue:

You could create another helper method with the same code but adjust the glob pattern there or change that in your forked and customized panini version: