From 30edd837e1c94e4c9807f1fa334d85862aff49f7 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Tue, 19 May 2026 12:24:01 +0100 Subject: [PATCH] Use resolve.tsconfig (#31639) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> GitOrigin-RevId: 1c7da49e14af5935f85f1927186a825b116bb4e9 --- services/web/tsconfig.json | 28 ++++++++++++++-------------- services/web/webpack.config.js | 9 +-------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/services/web/tsconfig.json b/services/web/tsconfig.json index 9063996b14..2e5fc9ad56 100644 --- a/services/web/tsconfig.json +++ b/services/web/tsconfig.json @@ -1,26 +1,26 @@ { "compilerOptions": { - "target": "esnext" /* Specify ECMAScript target version */, - "module": "esnext" /* Specify module code generation */, - "allowJs": true /* Allow JavaScript files to be compiled. */, + "target": "esnext", + "module": "esnext", + "allowJs": true, "resolveJsonModule": true, - // "checkJs": true /* Report errors in .js files. */, - "jsx": "preserve" /* Specify JSX code generation */, - "noEmit": true /* Do not emit outputs. */, - "strict": true /* Enable all strict type-checking options. */, - "moduleResolution": "bundler" /* Specify module resolution strategy */, + "jsx": "preserve", + "noEmit": true, + "strict": true, + "moduleResolution": "bundler", "isolatedModules": true, - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, - "skipLibCheck": true /* Skip type checking of declaration files. */, - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, - "experimentalDecorators": true /* Allow decorators in writefull - inversify */, - "emitDecoratorMetadata": true /* Allow decorators in writefull - inversify */, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "baseUrl": ".", "paths": { "@/*": ["./frontend/js/*"], "@modules/*": ["./modules/*"], "@overleaf/o-error": ["../../libraries/o-error"], "@overleaf/ranges-tracker": ["../../libraries/ranges-tracker"], - /* can't make this entry @types because that conflicts with the "types" entry below */ + "@ol-types/*": ["./types/*"], "@ol-storybook/*": ["./.storybook/*"], "@wf/*": ["./modules/writefull/frontend/js/integration/src/*"], diff --git a/services/web/webpack.config.js b/services/web/webpack.config.js index 904ef761ad..618d787e61 100644 --- a/services/web/webpack.config.js +++ b/services/web/webpack.config.js @@ -307,15 +307,8 @@ module.exports = { ], }, resolve: { + tsconfig: path.resolve(__dirname, 'tsconfig.json'), alias: { - // custom prefixes for import paths - '@': path.resolve(__dirname, './frontend/js/'), - '@modules': path.resolve(__dirname, './modules/'), - '@ol-types': path.resolve(__dirname, './types/'), - '@wf': path.resolve( - __dirname, - './modules/writefull/frontend/js/integration/src/' - ), // Ensure all packages use the same jQuery instance (prevents duplicate // copies from Yarn hoisting breaking jQuery plugins like daterangepicker) jquery: require.resolve('jquery'),