Skip to content

Commit

Permalink
include "build"-script
Browse files Browse the repository at this point in the history
  • Loading branch information
claasahl committed Jan 27, 2019
1 parent fdf4fda commit 45705f3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const configData = { yes: true, silent: true };
// * `basename` the tip of the package dir
// * `dirname` the parent of the package dir

init(dir, initFile, configData, function(_er, _data) {
init(dir, initFile, configData, function(_er, data) {
// the data's already been written to {dir}/package.json
// now you can do stuff with it
const packageFile = path.resolve(dir, "package.json");
Expand All @@ -34,7 +34,14 @@ init(dir, initFile, configData, function(_er, _data) {
"pre-commit": "pretty-quick --staged"
}
};
fs.writeFileSync(packageFile, JSON.stringify({ husky, ..._data }, null, 2));
const scripts = {
...data.scripts,
build: "tsc"
};
fs.writeFileSync(
packageFile,
JSON.stringify({ ...data, scripts, husky }, null, 2)
);

(async () => {
await execa("npm", ["install", "typescript", "@types/node", "--save-dev"]);
Expand Down

0 comments on commit 45705f3

Please sign in to comment.