Skip to content

Commit 1352d1c

Browse files
David Pazdavidmpaz
David Paz
authored andcommitted
Add missing extensions to config.resolve
Add extensions to resolve from type script.
1 parent 7e8c118 commit 1352d1c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/config-generator.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,13 @@ class ConfigGenerator {
6767

6868
config.stats = this.buildStatsConfig();
6969

70+
let extensions = ['.js', '.jsx'];
71+
if (this.webpackConfig.useTypeScriptLoader) {
72+
extensions = extensions.concat(['.json', '.ts', '.tsx']);
73+
}
74+
7075
config.resolve = {
71-
extensions: ['.js', '.jsx']
76+
extensions: extensions
7277
};
7378

7479
return config;

0 commit comments

Comments
 (0)