I'm trying to create an Angular Universal app building a specific route at build time to inject an AppShell into Index.html page as a means to get meaningful content in front of the user as soon as possible (while Angular app is downloading). I am following the instructions found at Angular University and I have it working as instructed. However, as I systematically add my existing app's functionality into this test app, I'm running into 'Unexpected token import' error stemming from a 3rd party plugin I need for the browser app, but is not needed for the very simple server app I'm trying to build and inject into Index.html as my App Shell.
I've spent several hours researching this and found a lot of posts out there recommending webpack, however, I'm using Angular CLI. I'm not sure how to incorporate webpack with Angular CLI build process.
I found this post that seems to indicate you can exclude modules from Angular Universal build using exclude portion of tsconfig.server.json. I've tried listing the modules to exclude in tsconfig.server.json, however, I'm still getting 'Unexpected token import' error.
I have a single route I need to build and inject into my Index page. I would hope/think I should be able to exclude the vast majority of my app as it has nothing to do with creating an AppShell. I would think Angular should simply build the necessary bits needed for the route(s) registered for the server app.
I'm using Angular CLI version 1.7.3 and Angular version 5.2.4.
Does anyone have insight as to how to exclude unnecessary modules from being built into an Angular Universal app?
Thanks for your time.