Skip to content

Commit 1f34db5

Browse files
committed
chore: add tsconfig paths webpack plugin
1 parent 52c7b62 commit 1f34db5

File tree

4 files changed

+72
-37
lines changed

4 files changed

+72
-37
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"stylelint-prettier": "^5.0.3",
5252
"terser-webpack-plugin": "^5.3.14",
5353
"tools": "workspace:^",
54+
"tsconfig-paths-webpack-plugin": "^4.2.0",
5455
"typescript": "^5.8.3"
5556
},
5657
"mpScriptsConfig": {

tsconfig.json

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,44 @@
11
{
2-
"compilerOptions": {
3-
"allowJs": true,
4-
"allowSyntheticDefaultImports": true,
5-
"baseUrl": ".",
6-
"downlevelIteration": true,
7-
"esModuleInterop": true,
8-
"experimentalDecorators": true,
9-
"forceConsistentCasingInFileNames": true,
10-
"isolatedModules": true,
11-
"jsx": "react-jsx",
12-
"lib": [
13-
"dom",
14-
"dom.iterable",
15-
"esnext"
16-
],
17-
"module": "esnext",
18-
"moduleResolution": "node",
19-
"noEmit": true,
20-
"noFallthroughCasesInSwitch": true,
21-
"paths": {
22-
"ts/*": ["src/assets/ts/*"],
23-
"acf-blocks/*": ["src/blocks/*"]
2+
"compilerOptions": {
3+
"allowJs": true,
4+
"allowSyntheticDefaultImports": true,
5+
"baseUrl": ".",
6+
"downlevelIteration": true,
7+
"esModuleInterop": true,
8+
"experimentalDecorators": true,
9+
"forceConsistentCasingInFileNames": true,
10+
"isolatedModules": true,
11+
"jsx": "react-jsx",
12+
"lib": [
13+
"dom",
14+
"dom.iterable",
15+
"esnext"
16+
],
17+
"module": "esnext",
18+
"moduleResolution": "node",
19+
"noEmit": true,
20+
"noFallthroughCasesInSwitch": true,
21+
"paths": {
22+
"@/*": [
23+
"src/assets/ts/*"
24+
],
25+
"acf-blocks/*": [
26+
"src/blocks/*"
27+
],
28+
"images/*": [
29+
"src/assets/images/*"
30+
]
31+
},
32+
"resolveJsonModule": true,
33+
"skipLibCheck": true,
34+
"strict": true,
35+
"target": "es5",
36+
"types": [
37+
"node",
38+
"youtube"
39+
]
2440
},
25-
"resolveJsonModule": true,
26-
"skipLibCheck": true,
27-
"strict": true,
28-
"target": "es5",
29-
"types": [
30-
"node",
31-
"youtube"
32-
]
33-
},
34-
"include": [
35-
"."
36-
]
41+
"include": [
42+
"."
43+
]
3744
}

webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
const defaultConfig = require('@micropackage/scripts/config/webpack.config');
22
const path = require('path');
3+
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
34

45
defaultConfig.resolve.alias.config = path.resolve(__dirname, 'config/');
56
defaultConfig.resolve.alias['acf-blocks'] = path.resolve(
67
__dirname,
78
'src/blocks/'
89
);
910

11+
defaultConfig.resolve.plugins = [new TsconfigPathsPlugin()];
12+
1013
module.exports = defaultConfig;

yarn.lock

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5875,6 +5875,7 @@ __metadata:
58755875
stylelint-prettier: "npm:^5.0.3"
58765876
terser-webpack-plugin: "npm:^5.3.14"
58775877
tools: "workspace:^"
5878+
tsconfig-paths-webpack-plugin: "npm:^4.2.0"
58785879
typescript: "npm:^5.8.3"
58795880
languageName: unknown
58805881
linkType: soft
@@ -6022,7 +6023,7 @@ __metadata:
60226023
languageName: node
60236024
linkType: hard
60246025

6025-
"enhanced-resolve@npm:^5.17.1":
6026+
"enhanced-resolve@npm:^5.17.1, enhanced-resolve@npm:^5.7.0":
60266027
version: 5.18.1
60276028
resolution: "enhanced-resolve@npm:5.18.1"
60286029
dependencies:
@@ -8979,7 +8980,7 @@ __metadata:
89798980
languageName: node
89808981
linkType: hard
89818982

8982-
"json5@npm:^2.1.2, json5@npm:^2.2.3":
8983+
"json5@npm:^2.1.2, json5@npm:^2.2.2, json5@npm:^2.2.3":
89838984
version: 2.2.3
89848985
resolution: "json5@npm:2.2.3"
89858986
bin:
@@ -9548,7 +9549,7 @@ __metadata:
95489549
languageName: node
95499550
linkType: hard
95509551

9551-
"minimist@npm:^1.2.0, minimist@npm:^1.2.8":
9552+
"minimist@npm:^1.2.0, minimist@npm:^1.2.6, minimist@npm:^1.2.8":
95529553
version: 1.2.8
95539554
resolution: "minimist@npm:1.2.8"
95549555
checksum: 10c0/19d3fcdca050087b84c2029841a093691a91259a47def2f18222f41e7645a0b7c44ef4b40e88a1e58a40c84d2ef0ee6047c55594d298146d0eb3f6b737c20ce6
@@ -13122,6 +13123,18 @@ __metadata:
1312213123
languageName: node
1312313124
linkType: hard
1312413125

13126+
"tsconfig-paths-webpack-plugin@npm:^4.2.0":
13127+
version: 4.2.0
13128+
resolution: "tsconfig-paths-webpack-plugin@npm:4.2.0"
13129+
dependencies:
13130+
chalk: "npm:^4.1.0"
13131+
enhanced-resolve: "npm:^5.7.0"
13132+
tapable: "npm:^2.2.1"
13133+
tsconfig-paths: "npm:^4.1.2"
13134+
checksum: 10c0/495c5ab7c1cb079217d98fe25d61def01e4bab38047c7ab25ec11876cc8c697ff01f43ea6c9933181875e51e49835407fc71afd92ea6cca1ba1bebf513dfb510
13135+
languageName: node
13136+
linkType: hard
13137+
1312513138
"tsconfig-paths@npm:^3.12.0":
1312613139
version: 3.14.0
1312713140
resolution: "tsconfig-paths@npm:3.14.0"
@@ -13134,6 +13147,17 @@ __metadata:
1313413147
languageName: node
1313513148
linkType: hard
1313613149

13150+
"tsconfig-paths@npm:^4.1.2":
13151+
version: 4.2.0
13152+
resolution: "tsconfig-paths@npm:4.2.0"
13153+
dependencies:
13154+
json5: "npm:^2.2.2"
13155+
minimist: "npm:^1.2.6"
13156+
strip-bom: "npm:^3.0.0"
13157+
checksum: 10c0/09a5877402d082bb1134930c10249edeebc0211f36150c35e1c542e5b91f1047b1ccf7da1e59babca1ef1f014c525510f4f870de7c9bda470c73bb4e2721b3ea
13158+
languageName: node
13159+
linkType: hard
13160+
1313713161
"tslib@npm:^1.8.1":
1313813162
version: 1.14.1
1313913163
resolution: "tslib@npm:1.14.1"

0 commit comments

Comments
 (0)