官术网_书友最值得收藏!

The Ionic project structure

So far, we have scaffolded a blank Ionic app and launched it in a browser. Now, we will walk through the scaffolded project structure.

If we open the chapter2 example1 folder in our text editor, we should see the following folder structure at the root of the project:

. 
├── config.xml
├── hooks
├── ionic.config.json
├── node_modules
├── package.json
├── platforms
├── plugins
├── resources
├── src
├── tsconfig.json
├── tslint.json
├── www

Here is a quick explanation of each of the items:

  • src: This is the folder where all the development happens. The app source code will be placed here. If you are coming from Ionic 1 to Ionic 2, this is the first change you would notice. For me, this is a very good upgrade to the folder structure, as it keeps the development code separate from the deployment code.
  • hooks: This folder consists of scripts that get executed when a particular Cordova task is performed. A Cordova task can be any of the following: after_platform_add (after a new platform is added), after_plugin_add (after a new plugin is added), before_emulate (before emulation begins), after_run (before the app is run), and so on. Each task is placed inside a folder named after the Cordova task.
  • resources: This folder consists of the various versions of the application icon and splash screen based on the mobile operating system.
  • www: This folder consists of the build Ionic code, written inside the src folder. All the code present inside this folder is intended to land inside the WebView.
  • config.xml: This file consists of all the meta information needed by Cordova while converting our Ionic app to a platform-specific installer. If you open config.xml, you will see a bunch of XML tags that describe our project. We will take a look at this file in detail again.
  • ionic.config.js: This file consists of the configuration that is needed for the build task.
  • package.json: This file consists of the project-level node dependencies.
  • tsconfig.json: This file consists of the TypeScript configuration.
  • tslint.json: This file consists of TS lint rules. To know more about these rules, refer to: https://palantir.github.io/tslint/rules/.
主站蜘蛛池模板: 巴南区| 沧源| 鹤峰县| 措美县| 大渡口区| 临湘市| 宁蒗| 长寿区| 辰溪县| 沭阳县| 中阳县| 项城市| 大邑县| 佳木斯市| 鄂托克前旗| 桦南县| 祥云县| 库伦旗| 榆中县| 山西省| 唐河县| 色达县| 辽阳县| 郎溪县| 水城县| 治县。| 中方县| 锡林郭勒盟| 柳州市| 泗洪县| 南昌市| 常熟市| 东丰县| 息烽县| 巧家县| 岚皋县| 名山县| 扶风县| 九龙坡区| 焦作市| 伊吾县|