I have a simple class
export default class Scott {
hello() {
let color: string = "blue";
return true;
}
}
However Webpack 4 throws this error: ERROR in ./src/js/test.ts Module parse failed: Unexpected token (3:17) You may need an appropriate loader to handle this file type.
If I change the "let" to let color = "blue"; then it works. Anytime I try to introduce a type I get the unexpected token error.
Is there something I need to include in the tsconfig file?