Skip to content

Commit a4877b8

Browse files
committed
Additional work on the silent flag
1 parent 8436ea8 commit a4877b8

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ Most TypeScript-related options should be set using a
4343
file. There are a few loader-specific options you can set although in general
4444
you should not need to.
4545

46-
##### silent *(boolean) (default='false')*
47-
If true, no console.log messages will be emitted.
46+
##### silent *(boolean) (default=false)*
47+
48+
If true, no console.log messages will be emitted. Note that most error
49+
messages are emitted via webpack which is not affected by this flag.
4850

4951
##### compiler *(string) (default='typescript')*
5052

@@ -57,7 +59,7 @@ Advanced option to force files to go through different instances of the
5759
TypeScript compiler. Can be used to force segregation between different parts
5860
of your code.
5961

60-
##### configFileName *(string) (default=tsconfig.json)*
62+
##### configFileName *(string) (default='tsconfig.json')*
6163

6264
Allows you to specify a custom configuration file.
6365

index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ interface TSInstances {
4949

5050
var instances = <TSInstances>{};
5151

52-
function consoleError(msg) {
53-
setTimeout(() => console.log('ERROR'+os.EOL+msg), 0)
54-
}
55-
5652
function handleErrors(diagnostics: typescript.Diagnostic[], compiler: typeof typescript, outputFn: (prettyMessage: string, rawMessage: string, loc: {line: number, character: number}) => any) {
5753
diagnostics.forEach(diagnostic => {
5854
var messageText = compiler.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL);
@@ -92,6 +88,10 @@ function ensureTypeScriptInstance(options: Options, loader: any): TSInstance {
9288
console.log.apply(console, messages);
9389
}
9490
}
91+
92+
function consoleError(msg) {
93+
setTimeout(() => log('ERROR'+os.EOL+msg), 0)
94+
}
9595

9696
var compiler = require(options.compiler);
9797
var files = <TSFiles>{};
@@ -233,6 +233,7 @@ function loader(contents) {
233233

234234
var options = loaderUtils.parseQuery<Options>(this.query);
235235
options = objectAssign<Options>({}, {
236+
silent: false,
236237
instance: 'default',
237238
compiler: 'typescript',
238239
configFileName: 'tsconfig.json'

0 commit comments

Comments
 (0)