-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@ngtools/webpack): suppress warnings for overwriting files in tsc
Since we're using a virtual filesystem, overwriting files by tsc does not affect actual files on the filesystem. This allows us to support allowJs without changing any configuration quirks. Fixes angular/angular#21080 Might help with #8371 Fixes #8885
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 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
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,18 @@ | ||
import { ng } from '../../utils/process'; | ||
import { updateTsConfig } from '../../utils/project'; | ||
import { appendToFile, writeFile } from '../../utils/fs'; | ||
|
||
export default async function() { | ||
await writeFile('src/my-js-file.js', 'console.log(1); export const a = 2;'); | ||
await appendToFile('src/main.ts', ` | ||
import { a } from './my-js-file'; | ||
console.log(a); | ||
`); | ||
|
||
await updateTsConfig(json => { | ||
json['compilerOptions'].allowJs = true; | ||
}); | ||
|
||
await ng('build'); | ||
await ng('build', '--aot'); | ||
} |