Skip to content

Commit 8b7a4e6

Browse files
committed
chore: upgrade to webpack@5.101.3
1 parent a9d953b commit 8b7a4e6

File tree

7 files changed

+495
-542
lines changed

7 files changed

+495
-542
lines changed

src/after-compile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ function removeCompilationTSLoaderErrors(
462462
loaderOptions: LoaderOptions
463463
) {
464464
compilation.errors = compilation.errors.filter(
465-
error => error.details !== tsLoaderSource(loaderOptions)
465+
error => error instanceof webpack.WebpackError && error.details !== tsLoaderSource(loaderOptions)
466466
);
467467
}
468468

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ function makeLoaderOptions(
298298
const hasForkTsCheckerWebpackPlugin =
299299
loaderContext._compiler?.options.plugins.some(
300300
plugin =>
301+
plugin !== null &&
301302
typeof plugin === 'object' &&
302303
plugin.constructor?.name === 'ForkTsCheckerWebpackPlugin'
303304
);
@@ -477,7 +478,7 @@ function getEmit(
477478

478479
addDependenciesFromSolutionBuilder(instance, filePath, addDependency);
479480

480-
loaderContext._module!.buildMeta.tsLoaderDefinitionFileVersions =
481+
if (loaderContext._module && loaderContext._module.buildMeta) loaderContext._module.buildMeta.tsLoaderDefinitionFileVersions =
481482
dependencies.map(
482483
defFilePath =>
483484
path.relative(loaderContext.rootContext, defFilePath) +

src/instances.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function successfulTypeScriptInstance(
141141
error: makeError(
142142
loaderOptions,
143143
colors.red('error while reading tsconfig.json:' + EOL + message),
144-
file
144+
file ?? ''
145145
),
146146
};
147147
}

src/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"outDir": "../dist",
1313
"declarationDir": "../dist",
1414
"declarationMap": true,
15-
"sourceMap": true,
16-
"skipLibCheck": true
15+
"sourceMap": true
1716
}
1817
}

src/watch-run.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,14 @@ function updateFile(
102102
loader.loadModule(request, (err, source) => {
103103
if (err) {
104104
reject(err);
105-
} else {
105+
} else if (typeof source === 'string') {
106106
const text = JSON.parse(source);
107107
updateFileWithText(instance, key, filePath, () => text);
108108
resolve();
109+
} else if (Buffer.isBuffer(source)) {
110+
const text = JSON.parse(source.toString('utf8'));
111+
updateFileWithText(instance, key, filePath, () => text);
112+
resolve();
109113
}
110114
});
111115
} else {

test/comparison-tests/getProgram.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
const typescript = require('typescript');
22
module.exports = function getProgram(tsconfigPath, optionsToExtend) {
3-
const parsedCommandLine = typescript.getParsedCommandLineOfConfigFile(tsconfigPath, optionsToExtend || {
4-
skipLibCheck: true
5-
}, {
3+
const parsedCommandLine = typescript.getParsedCommandLineOfConfigFile(tsconfigPath, optionsToExtend || {}, {
64
fileExists: typescript.sys.fileExists,
75
getCurrentDirectory: typescript.sys.getCurrentDirectory,
86
onUnRecoverableConfigFileDiagnostic: function () { throw new Error("Error building project") },

yarn.lock

Lines changed: 484 additions & 533 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)