我正在尝试获取用于设置项目的AngularJS框架,但似乎每个在线可用的框架都需要通过npm和/或bower安装大量依赖项。

由于该项目是针对一家公司的,并且存在安全问题,因此我试图避免通过nmp下载。我的想法是手动获取依赖项,但似乎无数。谁能建议我替代方案或提出解决方案?

这些是npm安装的依赖项:

"dependencies": {
"angular": "1.2.6",
"angular-cookies": "1.2.6",
"angular-resource": "1.2.6",
"angular-route": "1.2.6",
"angular-sanitize": "1.2.6",
"angular-http-auth": "1.2.1",
"async": "~0.2.5",
"bootstrap": "~3.0.3",
"angular-ui-bootstrap": "~0.10.0",
"es5-shim": "~2.1.0",
"jquery": "~1.10.2",
"json3": "~3.2.4",
"requirejs": "~2.1.9",
"underscore": "~1.5.2",
"pace": "~0.5.5",
"fontawesome-actions": "~0.5.0",
"ui-bootstrap": "~0.11.0",
"angular-bootstrap": "~0.11.0",
"selectn": "~0.9.6",
"select2": "~3.4.8",
"angular-ui-select2": "~0.0.5",
"angular-ui": "~0.4.0",
"inflection": "~1.3.8",
"momentjs": "~2.8.1",
"jquery-minicolors": "~2.1.6"


 },


"devDependencies": {
    "angular-mocks": "1.2.6",
    "angular-scenario": "1.2.6",
    "sinon": "~1.7.3",
    "chai": "~1.8.1"
  },

最佳答案

您可以使用bower仅安装所需的内容。

开始创建bower.json文件,您可以仅从某些软件包开始:

{
  "name": "Your_app_name",
  "description": "",
  "version": "0.0.0",
  "homepage": "",
  "license": "MIT",
  "private": true,
  "dependencies": {
    "bootstrap": "latest",
    "font-awesome": "latest",
    "animate.css": "latest",
    "angular": "latest",
    "angular-route": "latest",
    "angular-cookies": "latest",
    "angular-resource": "latest"
  }
}


然后运行:

$> bower install


并仅添加您需要的内容。
我创建了一个在开始新项目时使用的基本模板:https://github.com/etienne-bondot/angular-template

关于javascript - AngularJS的简单框架,没有依赖项,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31038630/

10-16 17:58