/shared-ignore

Generates .dockerignore, .npmignore, .gitignore

Primary LanguageJavaScriptMIT LicenseMIT

shared-ignore

Generates .dockerignore, .gitignore, .npmignore with shared patterns.

Installation

yarn add shared-ignore

or

npm i shared-ignore

package.json:

{
	// ...
	"scripts": {
		// ...
		"postinstall": "shared-ignore"
	},
	"sharedIgnore": {
		"all": ["node_modules/"],
		"docker": ["build/"],
		"git": [],
		"npm": ["source/", ".dockerignore"]
	}
}

This will generate the following files:

.gitignore:

# auto-generated by shared-ignore
node_modules/

.dockerignore:

# auto-generated by shared-ignore
node_modules/
build/

.npmignore:

# auto-generated by shared-ignore
node_modules/
source/
.dockerignore