Q:

const enum in typescript (tsc.js vs typescript.js)

I have a const enum in typescript:
const enum LogLevel {
    TRACE = 0,
    DEBUG = 1,
    INFO = 2,
    WARN = 3,
    ERROR = 4,
    SILENT = 5
}

Based on the typescript spec the following field:
private foo: number = LogLevel.DEBUG;
should be compiled as:
this.foo = 1 /* DEBUG */;

When I use tsc from the command line (Windows) it works as expected. But when it is compiled with awesome-typescript-loader in a webpack project (which uses the typescript.js from node_modules as opposed to the tsc.js which is used by tsc), then the enum constant is not getting inlined:
this.foo = LogLevel.DEBUG;

Both the tsc and the node module version are the same (2.0.2).
I think there should not be a difference between the two. Does anybody know why?

A:

It turned out it was caused by the declaration option in tsconfig.json. If it is set to false, the two compilations produce the above inconsistent result. But when it is set to true, it works as expected. Not sure why this flag has such an effect on the outcome. 

