Skip to content

Commit

Permalink
feat: move root and out options to tsconfig (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofrobots authored and JustinBeckwith committed Aug 4, 2017
1 parent 4ffa71c commit 443edfa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"scripts": {
"build": "npm run compile",
"clean": "rm -rf ./build/",
"compile": "tsc -p . --rootDir . --outDir build/",
"compile": "tsc -p .",
"format-check": "echo \"TODO\"",
"format": "clang-format -i -style='{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}' src/*.ts",
"lint": "tslint -c tslint.json --project . --type-check -t codeFrame",
Expand Down
4 changes: 2 additions & 2 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ async function query(
async function addScripts(
packageJson: any, options: Options): Promise<boolean> {
let edits = false;
const outDir = 'build/';
const scripts: Bag<string> = {
build: 'npm run compile',
clean: 'rm -rf ./build/',
compile: `tsc -p . --rootDir . --outDir ${outDir}`,
compile: `tsc -p .`,
fix: `gts fix`,
lint: `gts lint`
};
Expand Down Expand Up @@ -156,6 +155,7 @@ async function generateTsConfig(options: Options): Promise<void> {
const tsconfig = JSON.stringify(
{
extends: `${path.join(pkgDir, 'tsconfig-google.json')}`,
compilerOptions: {rootDir: '.', outDir: 'build'},
include: ['src/*.ts', 'src/**/*.ts', 'test/*.ts', 'test/**/*.ts'],
exclude: ['node_modules']
},
Expand Down
4 changes: 4 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"extends": "./tsconfig-google.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build"
},
"include": [
"src/*.ts",
"test/*.ts"
Expand Down

0 comments on commit 443edfa

Please sign in to comment.