0

I have done an Angular 2 application (and nothing fancy, might as well have just done a plain HTML/CSS/JS version of it).

Now that I want to do SEO I would much rather prefer converting my app to static HTML instead of going the Angular 2 Universal way.

I do not want to do any server side implementation of this, it would not suit my deployment environment at all. I just want straight *.html, *.sass/css (sass files I will obviously convert to CSS first), *.js files as the output which can be statically served on the web server.

What tool/utility can be used to help with this conversion? Would even be better if I can take my Angular 2 code through some webpack plugin that can spew out the static HTML version out on the other side.

Are there any such tools available at the moment?

0v3rst33r
  • 11
  • 1
  • 4
  • http://blog.mgechev.com/2016/06/26/tree-shaking-angular2-production-build-rollup-javascript/ – Günter Zöchbauer Nov 23 '16 at 07:38
  • The result of that is still an `Angular 2` application though, with no different version of the *source* files? Or am I missing something? I want to convert my `Angular 2` application's *source* to a set of files which makes it look like I actually just a composed a straight forward HTML/SASS/CSS/JS website without even touching `Angular 2`, so that I can continue with SEO tasks *without* any of the `Angular 2 Universal` type of solutions which for now will be a hindrance instead of a help. Eg: ng2 src -> webpack -> ng2 app bundles -> some tool -> straight forward HTML/SASS/CSS/JS files. – 0v3rst33r Nov 23 '16 at 07:46
  • No idea what you are talking about. When you build it you get plain HTML, JS, CSS. If you don't want to have in angular2.js script import you might be able to use some JS tools unrelated to Angular2 – Günter Zöchbauer Nov 23 '16 at 07:49
  • 1
    Btw, question about suggesting tools are discouraged here on SO anyway. – Günter Zöchbauer Nov 23 '16 at 07:50
  • "No idea what you are talking about. When you build it you get plain HTML, JS, CSS.". No you don't, you get a **single** index.html, and `Angular 2` is doing the heavy lifting to get the DOM setup correctly for each route (HTML view as per se) you follow. A core of my question was **SEO** related. Search engines do not think that one's ng2 app is straight fwd HTML/CSS/JS, because it is not. If you don't have ng2 bundled *with* your app, that HTML/CSS/JS is useless. I will write something that will run over my ng2 src base and extract code to be in line with a plain HTML project setup. – 0v3rst33r Nov 23 '16 at 07:58

0 Answers0