web-ext icon indicating copy to clipboard operation
web-ext copied to clipboard

Ignore more files by default

Open mbid opened this issue 6 years ago • 10 comments

Is this a feature request or a bug?

A feature request.

What is the current behavior?

web-ext only ignores a very limited set of files, e.g. dot files, .zips and the node_modules folder.

What is the expected or desired behavior?

web-ext should also ignore other common build files. For example, I have package.json, package-lock.json, yarn.lock, and web-ext-artifacts in my project directory, which shouldn't end up in the .xpi.

mbid avatar Oct 16 '17 07:10 mbid

Can't you just use --ignore-files?

kumar303 avatar Oct 24 '17 21:10 kumar303

Sure, but I could've also used that for node_modules. web-ext ignores some files because (I suppose) it's more convenient and less error-prone than specifying them every time. So I assumed that some more files should be ignored by web-ext by default. E.g. package.json and package-lock.json, which are very often also present if node_modules is and should not end up in the bundle.

mbid avatar Oct 25 '17 10:10 mbid

Yeah, that's true. I guess putting those files in the default list would make sense.

kumar303 avatar Oct 25 '17 16:10 kumar303

Also, once we have config files then you could use one to set the value of --ignore-files.

kumar303 avatar Nov 27 '17 21:11 kumar303

What's weird is that web-ext build ignores the web-ext-artifacts folder by default, but web-ext sign does not. That caught me off guard as it published my extension containing all the older builds of it, which was quite a bloated install for thousands of users.

carlin-q-scott avatar Jun 26 '19 17:06 carlin-q-scott

@carlin-q-scott That sounds like a bad bug. Could you open a new issue with steps to reproduce, including the version number and the output with the --verbose flag?

Rob--W avatar Jun 27 '19 14:06 Rob--W

@Rob--W Sure I guess. It seemed pretty closely related to this issue but I guess there's a difference in the impact of the bug.

carlin-q-scott avatar Jun 27 '19 19:06 carlin-q-scott

Also please ignore common dev's files like: README, README.txt, README.md, LICENSE, LICENSE.txt, LICENSE.md, CONTRIBUTING.md, HACKING, CODE_OF_CONDUCT.md etc. GitHub repos can also have .github folder. It also would be nice to exclude IDE's specific files like .idea which is created by WebSrorm. Maybe it even will be easier just to ignore all files from .gitignore

stokito avatar Sep 27 '19 17:09 stokito

I would expect built artifacts (e.g. generated by tools like webpack) to be .gitignored. Excluding those in the build output would result in non-functional extensions, so I don't think that we should automatically import the ignores from .gitignore.

Rob--W avatar Sep 30 '19 09:09 Rob--W

I think web-ext could use modules like these to exclude common junk:

https://github.com/sindresorhus/junk/blob/master/index.js https://github.com/novemberborn/ignore-by-default/blob/master/index.js https://github.com/abranhe/init-gitignore/blob/master/gitignore/Node.gitignore

fregante avatar Nov 02 '19 15:11 fregante