Separate Angular2 TypeScript files and JavaScript files into different folders, maybe 'dist‘

后端 未结 16 2302
清酒与你
清酒与你 2020-11-28 19:52

I am using the 5 min quickstart from angular.io website, which contain a file structure like this:

angular2-quickstart
 app
   app.component.ts
   boot.ts
 i         


        
16条回答
  •  半阙折子戏
    2020-11-28 20:15

    I tried the solutions listed here. They are good, but not ideal for me. I want a simple solution. I don't want to hard-code the path information in all my component files. I don't want to install more npm packages to take care of this.

    So I come up an easiest alternative. It's not a direct answer to this question, but it works very well for me.

    I just tweak my workspace settings so that the js files under /app don't show. They are still there. They are just hidden from my workspace. To me, that's enough.

    I'm using Sublime Text, so here is what I have for my project settings:

    "file_exclude_patterns": ["app/*.js"]
    

    I'm sure many other editors have similar functions.

    UPDATE:

    Just use Angular CLI. Everything is taken care of automatically.

提交回复
热议问题