1

I am perhaps falling into the realms of opinion but I need some advice. I've been playing around with Angular2 in TypeScript and am really liking it. I have built a few little test projects and they are running fine locally but now I want to push them live and I find myself stumped on how exactly to do this.

Where in the past I might I have had a bunch of JS files to concat and minify I now have a pretty complex directory structure of .ts, .map and .js files as well as .html and .css for the templates.

So, what I'm after is the best way to get this structure live. I assume it is not best practice to just upload the lot as-is?

I've googled and found myself reading up on various things but starting from scratch is not easy - reading about JSPM leads to reading about SystemJS which leads to reading about NodeJS and suddenly I can't remember where I even started from. I've found a few seed projects but they seem to be designed to cover a wide range of builds and right now I want to keep as basic as possible and not have to be learning about linting and unit-testing and the rest - that can come later.

I understand this is probably not going to have a simple answer that works across the board but even some great beginner tutorials would be really helpful if anyone can provide.

Thanks in advance

popClingwrap
  • 3,919
  • 5
  • 26
  • 44

1 Answers1

0

Your question seems to revolve much about directory structure, and the most efficient way to organize all these files as well as get them to a live site. Typescript needs to be transpiled of course into JavaScript as you know, this is what SystemJS will be using to build your site. There's nothing wrong with pushing those transpile/compiled files to a web server, as long as the directory structure is organized enough by component that you can tell what is going on. Keeping the directory structure simple enough is key to being able to build from a foundational project.

To adhere to a good structure organization I would recommend looking at the Angular 2 seed that I created here. It consists of a fairly simple Angular 2 component structure and has a pretty flat folder structure. For more Angular 2 organization guidelines I recommend looking at Minko Gechev's Angular 2 style guide. It helps keep things organized by bounded context so nothing gets messy even with all of your template and transpiled files in the directory.

Dominic Farolino
  • 1,362
  • 1
  • 20
  • 40