Skip to content

Commit 5b97111

Browse files
committed
Update tsconfig.json to check files in entire repo
1 parent 41faca7 commit 5b97111

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

tools/webpack/utils.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,11 @@ const createPluginZip = ( pluginPath, pluginName ) => {
149149
] );
150150

151151
if ( 0 !== proc.status ) {
152-
throw new Error(
153-
proc.error || proc.stderr.toString() || proc.stdout.toString()
154-
);
152+
if ( proc.error ) {
153+
throw proc.error;
154+
} else {
155+
throw new Error( proc.stderr.toString() || proc.stdout.toString() );
156+
}
155157
}
156158
};
157159

tsconfig.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
"noEmit": true,
55
"allowJs": true,
66
"target": "es2020",
7-
"moduleResolution": "node",
8-
"module": "esnext",
9-
"skipLibCheck": true
7+
"moduleResolution": "nodenext",
8+
"module": "nodenext",
9+
"skipLibCheck": true,
10+
"resolveJsonModule": true
1011
},
1112
"include": [
12-
"plugins/**/*.js",
13-
"plugins/**/*.ts",
13+
"*.js",
14+
"*.mjs",
15+
"*.ts",
1416
],
1517
"exclude": [
1618
"plugins/*/build/*"

webpack.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const performanceLab = ( env ) => {
7676
},
7777
],
7878
} ),
79+
// @ts-expect-error TS2351: WebpackBar is constructable when using require(), type definitions might be geared towards ESM.
7980
new WebpackBar( {
8081
name: 'Building Performance Lab Assets',
8182
color: '#2196f3',
@@ -113,6 +114,7 @@ const embedOptimizer = ( env ) => {
113114
},
114115
],
115116
} ),
117+
// @ts-expect-error TS2351: WebpackBar is constructable when using require(), type definitions might be geared towards ESM.
116118
new WebpackBar( {
117119
name: 'Building Embed Optimizer Assets',
118120
color: '#2196f3',
@@ -162,6 +164,7 @@ const imagePrioritizer = ( env ) => {
162164
},
163165
],
164166
} ),
167+
// @ts-expect-error TS2351: WebpackBar is constructable when using require(), type definitions might be geared towards ESM.
165168
new WebpackBar( {
166169
name: 'Building Image Prioritizer Assets',
167170
color: '#2196f3',
@@ -217,6 +220,7 @@ const optimizationDetective = ( env ) => {
217220
},
218221
],
219222
} ),
223+
// @ts-expect-error TS2351: WebpackBar is constructable when using require(), type definitions might be geared towards ESM.
220224
new WebpackBar( {
221225
name: 'Building Optimization Detective Assets',
222226
color: '#2196f3',
@@ -250,6 +254,7 @@ const viewTransitions = ( env ) => {
250254
},
251255
],
252256
} ),
257+
// @ts-expect-error TS2351: WebpackBar is constructable when using require(), type definitions might be geared towards ESM.
253258
new WebpackBar( {
254259
name: 'Building View Transitions Assets',
255260
color: '#2196f3',
@@ -299,6 +304,7 @@ const webWorkerOffloading = ( env ) => {
299304
},
300305
],
301306
} ),
307+
// @ts-expect-error TS2351: WebpackBar is constructable when using require(), type definitions might be geared towards ESM.
302308
new WebpackBar( {
303309
name: 'Building Web Worker Offloading Assets',
304310
color: '#FFC107',
@@ -374,6 +380,7 @@ const buildPlugin = ( env ) => {
374380
} );
375381
},
376382
},
383+
// @ts-expect-error TS2351: WebpackBar is constructable when using require(), type definitions might be geared towards ESM.
377384
new WebpackBar( {
378385
name: `Building ${ env.plugin } Plugin`,
379386
color: '#4caf50',

0 commit comments

Comments
 (0)