diff options
-rw-r--r-- | lib/template.js | 29 |
1 files changed, 28 insertions, 1 deletions
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; |