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'),