Our current project is transitioning from AngularJS to Angular 4, and as part of this process, we are first rewriting everything in TypeScript and converting AngularJS components. To facilitate this transition, we have set up a new project using AngularJS + Webpack + TypeScript, where we are converting legacy AngularJS modules to TypeScript. However, due to the size of the project, we need to temporarily include the 'old' AngularJS modules and execute their scripts to ensure that the project functions correctly.
We are facing challenges in integrating these old modules into our project structure. Our app.module.ts file looks something like this:
import * as angular from 'angular';
import { moduleName as convertedModule1 } from './app/converted.module1';
import { moduleName as convertedModule2 } from './app/converted.module2';
export const moduleName =
angular.module('application', [
convertedModule1,
convertedModule2,
'legacy_module_3',
'legacy_module_4'
]).name;
While convertedModule1 and convertedModule2 have been successfully migrated to TypeScript, 'legacy_module_3' and 'legacy_module_4' remain in their original AngularJS form. We are looking for a way to reference these old modules (located at '/frontend/module3.js' and '/frontend/module4.js') within our webpack setup so that their JavaScript code can be executed. Any suggestions on how we can achieve this integration?