I've old Angular 1.x app bundled into one, big app.js file (ES5) which attached to index.html
<html ng-app="app">
<body>
<!-- Main view -->
<div ui-view></div>
<script type="text/javascript" src="js/app.js"></script>
</body>
</html>
and I want to use it in SPFXframework (TypeScript and Webpack based solution) with minimal effort (without rewriting everyting into Typescript). I want to use legacy app.js "as is" (as external Javascript lib) without installing every single dependency (npm install fullcalendar, npm install jquery-minicolors etc) since not each component is exposed as npm package.
I've tried to use import or require() function, but when I use require('./assets/app.js') it gives me error:
ERROR in ./src/webparts/newsolution/assets/app.js Module not found: Error: Can't resolve 'fullcalendar' in '...\spfx\src\webparts\test\assets'
ERROR in ./src/webparts/newsolution/assets/app.js Module not found: Error: Can't resolve 'jquery-minicolors' in ''...\spfx\src\webparts\test\assets'
for every single component which is bundled into legacy app.js (over 20 components) I want to exclude legacy app.js from typescript compilation. The goal is to attach ng-app into specific in method render() in Typescript (the same as I've in index.html in legacy Angular app)
public render(): void {
require('./assets/app.js')
this.domElement.innerHTML = `
<div>
</div>
}
angular.bootstrap(this.domElement, ['app']);
}