How to exclude files in manifest.json?

I’m trying to figure out how Manifest V3 works by applying web-ext lint to my Manifest V2 extension, but it doesn’t actually say what to do about the lints I’m encountering. Two representative examples:

FLAGGED_FILE_EXTENSION   Flagged file extensions found       Files were found that are either unnecessary or have been included unintentionally. They should be   gradle/wrapper/gradle-wrapper.jar                                
INLINE_SCRIPT            Inline scripts blocked by default   Default CSP rules prevent inline JavaScript from running (                   build/resources/test/index.html              

Both of those files are relevant for running tests of the extension, but should of course not be included in the XPI. I’ve been using a build script which creates a zip file with the exact right files, because I can’t see any options in manifest.json to control which files should be included. Is there such an option, in manifest.json or elsewhere?

Usually, when you have a build script, you have a root folder with subfolders like:

  • src - where all the source code is
  • dist (or "build) - where the addon is build from the source code
  • test - where your test lives

You want the linter to run in the “dist” folder - where the final built addon is (there should be also manifest.json file).

That way, the linter won’t bother with files that are not relevant to the final addon (like tests).

OK, so building the zip file directly from the root of the source tree isn’t recommended. Thanks, that clears things up.