s-panferov / awesome-typescript-loader

Awesome TypeScript loader for webpack
Other
2.35k stars 181 forks source link

Can't resolve '../types/TSourceMapMode' #248

Open sanex3339 opened 7 years ago

sanex3339 commented 7 years ago

I getting the error only with awesome-typescript-loader and only in one file:

Can't resolve '../types/TSourceMapMode'

With ts-loader and raw typescript everything is ok.

Typescript@2.0.3

Import https://github.com/sanex3339/javascript-obfuscator/blob/dev/src/options/Options.ts:

import { TSourceMapMode } from "../types/TSourceMapMode";

File TSourceMapMode.d.ts https://github.com/sanex3339/javascript-obfuscator/blob/dev/src/types/TSourceMapMode.d.ts:

export type TSourceMapMode = 'inline' | 'separate';

In other files everything is OK: https://github.com/sanex3339/javascript-obfuscator/blob/dev/src/interfaces/IOptions.d.ts

sanex3339 commented 7 years ago

It seems that the d.ts extension - the cause of the error. If i replace name filename to TSourceMapMode.ts - everything is ok. But why on other files no error? File with types should has d.ts extension.

sanex3339 commented 7 years ago

Same problem as here: https://github.com/s-panferov/awesome-typescript-loader/issues/225