From d7004f856a3d2ec0c9220ee6ca945fe0441e5676 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sun, 13 Oct 2019 13:14:58 +0200 Subject: Allow drop some dev. dependencies --- lib/template.js | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/template.js b/lib/template.js index 9664d88..991f441 100644 --- a/lib/template.js +++ b/lib/template.js @@ -1,3 +1,16 @@ +// XXX We will never use in our builds. +// XXX Original names, e. g. "@foo/bar". +const devDepsBlackList = [ + "better-npm-run", + "doctoc", + "eslint", + "husky", + "lint-staged", + "live-server", + "npm-run-all", + "watch", +]; + function normalize(name) { return name.replace('/', '-').replace('@', '').replace('.', '-'); } @@ -35,6 +48,16 @@ function render({ }) { const deps = pkg.dependencies || {}; const devDeps = pkg.devDependencies || {}; + + var dropDevDependencies = []; + + devDepsBlackList.forEach((d) => { + if (devDeps[d]) { + delete devDeps[d]; + dropDevDependencies.push(d); + } + }); + const npmInputs = Object.keys({...deps, ...devDeps }).sort().map(normalize); @@ -85,8 +108,12 @@ ${source} npmInputs = [ ${fmt(npmInputs, 80, ' ', '\n ')} ]; + + dropDevDependencies = [ + ${fmt(dropDevDependencies.sort().map(d => `"${d}"`), 80, ' ', '\n ')} + ]; } `; } -module.exports = render; \ No newline at end of file +module.exports = render; -- cgit v1.2.3