-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: process config file form extends section of tsconfig #59
- Loading branch information
Showing
4 changed files
with
46 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"extends": "./59-tsconfig.paths.json", | ||
"paths": { | ||
"alias/*": [ "target/*" ] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"paths": { | ||
"alias-paths/*": [ "target-paths/*" ] | ||
} | ||
} | ||
} |
13 changes: 11 additions & 2 deletions
13
packages/react-app-alias/__tests__/react-app-alias.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
'use strict'; | ||
|
||
const reactAppAlias = require('../src'); | ||
const path = require('path') | ||
const {configPathsRaw} = require('../src'); | ||
|
||
describe('react-app-alias', () => { | ||
test.todo('tested by tests in projects in example folder'); | ||
}); | ||
|
||
describe('extends section of tsconfig on detect config file stage', () => { | ||
test('read both file and extends', () => { | ||
const paths = configPathsRaw(path.resolve(__dirname, './59-tsconfig.json')) | ||
expect(paths['alias/*'][0]).toBe('target/*'); | ||
expect(paths['alias-paths/*'][0]).toBe('target-paths/*'); | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters