I have a legacy application that is a mix of static HTML Typescript and JS. The JS/TS was bundled using bundlconfig from Webgrease (a .Net MVC package). The JS libs/TS references were added to the project using Nuget.
90% of the client side app is build using TS, all with ambient bindings. MSBuild compiels the TS, and then the resulting JS gets put in a single bundle and referenced by my html template.
There are a few named script references like jQuery, and Bootstrap.js.
I would like to use NPM and Webpack, so I have access to newer version of JS libraries, and for various other reasons.
I don't have defined 'index.js' entry points for my pages, basically the script section of the page is the index.js. i.e.,
<script>
$(document).ready(function(){
var myPageControllerWrittenInTypescript = new MyPageControllerWrittenInTypescript(1,2,3);
myPageControllerWrittenInTypescript.init();
});
</script>
Problem #1: Grep tells me there are about 100 of these pages. I know I create a separate entry point to every one of these pages, and then reference that specific endpoint in that page. But I am looking for an intermediate step that is less work, that would allow these small embedded entry points to continue to work.
Problem #2:
All the typescript in this application is just using ambient bindings. And 3rd party TS bindings referenced in a references.ts file full of lines like this /// <reference path="../scripts/typings/bootstrap/bootstrap.d.ts" />. Is it possible to have webpack bundle the TS application, without a defined entry point? I know without an entry point, I won't be able to tank advantage of common chunks etc.
Thanks.