Skip to content

Commit 6b94639

Browse files
authored
Merge pull request wmonk#223 from diabelb/master
Fixed problem with tsconfig.json baseUrl and paths
2 parents d467b98 + d5b370d commit 6b94639

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

packages/react-scripts/config/webpack.config.dev.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
1919
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
2020
const getClientEnvironment = require('./env');
2121
const paths = require('./paths');
22+
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
2223

2324
// Webpack uses `publicPath` to determine where the app is being served from.
2425
// In development, we always serve from the root. This makes config easier.
@@ -123,6 +124,7 @@ module.exports = {
123124
// please link the files into your node_modules/ and let module-resolution kick in.
124125
// Make sure your source files are compiled, as they will not be processed in any way.
125126
new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),
127+
new TsconfigPathsPlugin({configFile: paths.appTsConfig})
126128
],
127129
},
128130
module: {

packages/react-scripts/config/webpack.config.prod.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
2020
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
2121
const paths = require('./paths');
2222
const getClientEnvironment = require('./env');
23+
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
2324

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

packages/react-scripts/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"sw-precache-webpack-plugin": "0.11.4",
4444
"ts-jest": "^20.0.7",
4545
"ts-loader": "^2.3.7",
46+
"tsconfig-paths-webpack-plugin": "^2.0.0",
4647
"tslint": "^5.7.0",
4748
"tslint-loader": "^3.5.3",
4849
"tslint-react": "^3.2.0",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy