I love the capabilities that this CLI provides, but it's real world implementation is a nightmare. Let's say for instance someone has a pre-existing project using A1 with Jade/Pug. The conversion to A2 is extremely problematic. Beyond having to gulp your jade/pug into basic html before you build your project, the build process dumps all of it's created files into one directory "dist". From the outside this seems fine, and for some simple implementations of A2 it would be fine. But for more real world solutions it is very problematic. First off, the resulting html and JS files should be able to be relocated (split into different directories) defined by entries in the angular-cli.json.
MEAN stack project example
If we point the build to output it's contents to where we can display the resulting HTML '/views/dist', then we cannot access the accompanying .JS bundles. If we output the contents of the build to our public folders like "/public/dist", then our node routing cannot access the HTML.
So beyond moving either the JS or HTML results to separate directories manually, this solution doesn't work for us.
Now beyond that, once you have separated the HTML & JS bundles it would make things very handy if you could generate an additional HTML file within the build results. This file would ONLY have the references to the JS bundles; say you name it Resouces.html.
Example "Resources.html":
*** assume these are formatted appropriately ***
src="/js/custom/location/inline.js"
src="/js/custom/location/main.4b35c69fe3ac9cc5dbdd.bundle.js"
If you generated the "Resources.html" file in the build process, then we could simply include it in our base Jade/Pug starting point and forgo working with the resulting HTML entirely.
Currently, even with all of the shuffling around we are doing our base (app-entry) jade/pug file looks like this.
block content
include index.html
If you have further questions or need examples, I would be happy to provide them.
All the best,
-d
I love the capabilities that this CLI provides, but it's real world implementation is a nightmare. Let's say for instance someone has a pre-existing project using A1 with Jade/Pug. The conversion to A2 is extremely problematic. Beyond having to gulp your jade/pug into basic html before you build your project, the build process dumps all of it's created files into one directory "dist". From the outside this seems fine, and for some simple implementations of A2 it would be fine. But for more real world solutions it is very problematic. First off, the resulting html and JS files should be able to be relocated (split into different directories) defined by entries in the angular-cli.json.
MEAN stack project example
If we point the build to output it's contents to where we can display the resulting HTML '/views/dist', then we cannot access the accompanying .JS bundles. If we output the contents of the build to our public folders like "/public/dist", then our node routing cannot access the HTML.
So beyond moving either the JS or HTML results to separate directories manually, this solution doesn't work for us.
Now beyond that, once you have separated the HTML & JS bundles it would make things very handy if you could generate an additional HTML file within the build results. This file would ONLY have the references to the JS bundles; say you name it Resouces.html.
Example "Resources.html":
*** assume these are formatted appropriately ***
src="/js/custom/location/inline.js"
src="/js/custom/location/main.4b35c69fe3ac9cc5dbdd.bundle.js"
If you generated the "Resources.html" file in the build process, then we could simply include it in our base Jade/Pug starting point and forgo working with the resulting HTML entirely.
Currently, even with all of the shuffling around we are doing our base (app-entry) jade/pug file looks like this.
block content
include index.html
If you have further questions or need examples, I would be happy to provide them.
All the best,
-d