Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Commit d5b370d

Browse files
committed
Fixed problem with tsconfig.json baseUrl and paths
1 parent 22e52e1 commit d5b370d

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

Diff for: packages/react-scripts/config/webpack.config.dev.js

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
2121
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
2222
const getClientEnvironment = require('./env');
2323
const paths = require('./paths');
24+
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
2425

2526
// Webpack uses `publicPath` to determine where the app is being served from.
2627
// In development, we always serve from the root. This makes config easier.
@@ -126,6 +127,7 @@ module.exports = {
126127
// please link the files into your node_modules/ and let module-resolution kick in.
127128
// Make sure your source files are compiled, as they will not be processed in any way.
128129
new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),
130+
new TsconfigPathsPlugin({configFile: paths.appTsConfig})
129131
],
130132
},
131133
module: {

Diff for: packages/react-scripts/config/webpack.config.prod.js

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
2222
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
2323
const paths = require('./paths');
2424
const getClientEnvironment = require('./env');
25+
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
2526

2627
// Webpack uses `publicPath` to determine where the app is being served from.
2728
// It requires a trailing slash, or the file assets will get an incorrect path.
@@ -130,6 +131,7 @@ module.exports = {
130131
// please link the files into your node_modules/ and let module-resolution kick in.
131132
// Make sure your source files are compiled, as they will not be processed in any way.
132133
new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),
134+
new TsconfigPathsPlugin({configFile: paths.appTsConfig})
133135
],
134136
},
135137
module: {

Diff for: packages/react-scripts/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"style-loader": "0.18.2",
4141
"ts-jest": "^20.0.7",
4242
"ts-loader": "^2.3.7",
43+
"tsconfig-paths-webpack-plugin": "^2.0.0",
4344
"tslint": "^5.7.0",
4445
"tslint-loader": "^3.5.3",
4546
"tslint-react": "^3.2.0",

0 commit comments

Comments
 (0)