Skip to content

Commit fc0130b

Browse files
committed
Merge branch 'feature/webpack-tsconfig-paths' into develop
2 parents 14d02fd + 52adae2 commit fc0130b

File tree

3 files changed

+114
-8
lines changed

3 files changed

+114
-8
lines changed

package-lock.json

Lines changed: 108 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"ts-jest": "^28.0.5",
7272
"ts-loader": "^9.3.1",
7373
"tsconfig-paths": "^4.0.0",
74+
"tsconfig-paths-webpack-plugin": "^3.5.2",
7475
"typescript": "^4.7.4",
7576
"webpack": "^5.73.0",
7677
"webpack-cli": "^4.10.0"

webpack.config.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const lodash = require('lodash');
22
const CopyPlugin = require('copy-webpack-plugin');
33
const HtmlWebpackPlugin = require('html-webpack-plugin');
4+
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
45
const path = require('path');
56

67
function srcPaths(src) {
@@ -17,15 +18,11 @@ const commonConfig = {
1718
output: { path: srcPaths('dist') },
1819
node: { __dirname: false, __filename: false },
1920
resolve: {
20-
alias: {
21-
_: srcPaths('src'),
22-
_main: srcPaths('src/main'),
23-
_models: srcPaths('src/models'),
24-
_public: srcPaths('public'),
25-
_renderer: srcPaths('src/renderer'),
26-
_utils: srcPaths('src/utils'),
27-
},
2821
extensions: ['.js', '.json', '.ts', '.tsx'],
22+
plugins: [new TsconfigPathsPlugin({
23+
configFile: './tsconfig.json',
24+
extensions: ['.js', '.json', '.ts', '.tsx'],
25+
})],
2926
},
3027
module: {
3128
rules: [

0 commit comments

Comments
 (0)