Skip to content

Add option to exclude files #390

@m1ga

Description

@m1ga

The hooks in:
https://github.com/tidev/hyperloop.next/blob/master/android/hooks/tasks/scan-references-task.js#L301
https://github.com/tidev/hyperloop.next/blob/master/iphone/hooks/hyperloop.js#L587
include all files and tries to babel parse them. Depending on your files it will also include node_modules folders that you don't want to have in there (e.g. inspect-js/has-symbols#1 produces an error).

It would be nice to have an option to exclude e.g. node_modules/**/test to be included/parsed.
PoC:

		// Now traverse the AST and generate modified source
		if (!file.includes("node_modules/")) {
			const ast = babelParser.parse(originalSource, { sourceFilename: file, sourceType: 'unambiguous' });
			traverse(ast, HyperloopVisitor);
		}

makes it build again. Of course it should be a config option and not just the fixed node_modules folder. We could open .babelrc because that can contain:

{
  "ignore": [
    "**/node_modules/**/test"
  ]
}

check the app folder if the file is there, then read the ignore node and the content.

Test

  • create an app
  • include hyperloop
  • inside app/lib run npm i has-symbols
  • build the app
  • it should fail with "'return' outside of function"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions