首先认识requirejs
requirejs是个包加载器,核心功能是模块化管理,可以实现按需加载。 重点是明白 模块化不是按需加载。
模块化的意义: 是通过代码逻辑表明模块之间的依赖关系和执行顺序,按照模块逻辑来分解代码,起到配合mvc框架架构项目的作用。
按需加载:顾名思义 根据需要 通过模块依赖 event事件 加载所需的模块。
因为做的本地混合应用,在我项目中的主要的作用是模块化,我使用requirejs的原因是模块化管理,不是按需加载。
backbone 配合 requirejs 架构前端方案 https://github.com/breakfriday/backboneMvc-requirejs
backbone是非常经典的前端mvc框架 除了mvc几乎没有其他功能。
如果用backbone这一类框架 架构项目 流程:
ipRK6WPKh7f8bbfbo/7MH6rMMIXhw/TuY/iQ9OKUmFduLZktqH93rX8JAS6Dsy2s0vml0vB5d7v37wzcbDZHZbau69KvD59KVwMl5sV7+fLlDz/8sO/dde0A9S9t/UsIcBmcbaFef//73/dVn+eXSnc2ag2foXdYM3jEeYVjwygxL96bN29+8Ytf/Pu///tf//rXd+/eZe+uaweof2nrX0KAy+BsC/V6+PBh0zQff/zxH/7wh5cvX6ZvnV8qjT7DIMgeWhA7d2VPOIgf2/3UMTLtA3ZU98g45eGzy9PnMZz8YyMl5jX48ssvwz7z4YcfPnz4MP3Dx2w7wL6nlbRtG46UePhkO3b4QHg9W9r4VpxmPEbCK/EDZ96Yen8OKIB5ONtCvUJmix48ePDo0aMQ3s4sldJ7z/bpum40JoUHf8euj6FAHN63M6w475Q9jjz9eqhxj5raKCXmNfj222/TA+dnP/tZbHabeQfYbrfDv1yEZBUOn3Akpm9lj4hM34oH7GazSSfbtm089KYexSfjgAKYh7MtJd3e3jZM73e/+12zaGZrBn/InyKzTVF9Nk3z4MGDJTcey/mXf/mXpo7Mlh4p8b9ZftsliSj8oeTARMIn5++NPPP6BLhazraU5PpdVtbO9tFHH3355ZcvXrzYTdw3Mjjczpa9eGbfyPiVdI6xd1nBjl520Wvw+vXrLK198MEHDx8+fPPmTc2Zre/77MiKSxs7D6fS43c47us8HFAA83C2pSTX77JCZvvw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