标签: grunt-wiredep

Grunt wiredep:app没有这样的文件或目录bower.json

我正在尝试将我的Yeoman的Angular应用程序部署到我的生产服务器上.当我尝试运行grunt构建命令时,我收到此错误:

运行"wiredep:app"(wiredep)任务警告:ENOENT,没有这样的文件或目录'/usr/share/nginx/html/data/gaia-app/app/bower.json'使用--force继续.

如果我使用grunt --force我的应用程序已损坏...

我在Ubuntu 14.04上

有任何想法吗?

gruntjs grunt-wiredep

42
推荐指数
2
解决办法
2万
查看次数

是否有像grunt-wiredep这样的注入器适用于NPM依赖?

现在大多数包都可以在NPM和Bower中使用.我必须有NPM,但我想在我的项目中切断Bower.

我目前正依赖于grunt-wiredep创建<script>包含在我的index.html.这个工具查看所有Bower配置,将所有必要的js和css文件提取到我index.html的手中.

是否有一个工具可以为NPM依赖项做同样的事情?

npm gruntjs bower grunt-wiredep wiredep

25
推荐指数
1
解决办法
6147
查看次数

如何控制wiredep如何生成bower文件路径以及如何控制添加/删除哪些文件

我的应用程序有如下目录

app - > appName - > index.html(js,css)

由于某种原因,这个appName包装器文件夹弄乱了有线电视

{ dest: '.tmp/concat/scripts/vendor.js',
      src: 
       [ '../bower_components/es5-shim/es5-shim.js',
         '../bower_components/angular/angular.js',
         '../bower_components/json3/lib/json3.js',
         '../bower_components/angular-resource/angular-resource.js',
         '../bower_components/angular-cookies/angular-cookies.js',
         '../bower_components/angular-sanitize/angular-sanitize.js',
         '../bower_components/angular-animate/angular-animate.js',
         '../bower_components/angular-touch/angular-touch.js',
         '../bower_components/angular-route/angular-route.js' ] },
Run Code Online (Sandbox Code Playgroud)

这是如果目录如下所产生的

app - > index.html(js,css)

{ dest: '.tmp/concat/scripts/vendor.js',
      src: 
       [ 'bower_components/es5-shim/es5-shim.js',
         'bower_components/angular/angular.js',
         'bower_components/json3/lib/json3.js',
         'bower_components/angular-resource/angular-resource.js',
         'bower_components/angular-cookies/angular-cookies.js',
         'bower_components/angular-sanitize/angular-sanitize.js',
         'bower_components/angular-animate/angular-animate.js',
         'bower_components/angular-touch/angular-touch.js',
         'bower_components/angular-route/angular-route.js' ] },
Run Code Online (Sandbox Code Playgroud)

和wiredep确实改变了index.html的脚本内容,我该如何控制该流?有时它从其脚本[src]剥离角度消毒

grunt-wiredep

17
推荐指数
3
解决办法
8487
查看次数

使用grunt-wiredep为Grunt + Bower提供的绝对路径

grunt-wiedep任务输出资产的相对路径.我需要绝对路径.所以,我replace按照这里的建议重新配置了这个块:https://github.com/stephenplusplus/grunt-wiredep/issues/46

但是,在replace按照建议指定块之后,我将以下内容添加为我的脚本引用.如你所见,这是错误的.

<script src="/../../../public/vendors/jquery/dist/jquery.js"></script>
<script src="/../../../public/vendors/angular/angular.js"></script>
<script src="/../../../public/vendors/angular-resource/angular-resource.js"></script>
<script src="/../../../public/vendors/angular-route/angular-route.js"></script>
Run Code Online (Sandbox Code Playgroud)

我想要的是这样:

<script src="/vendors/jquery/dist/jquery.js"></script>
<script src="/vendors/angular/angular.js"></script>
<script src="/vendors/angular-resource/angular-resource.js"></script>
<script src="/vendors/angular-route/angular-route.js"></script>
Run Code Online (Sandbox Code Playgroud)

所以,我尝试了这个替换块.注意RegEx:

replace: {
    js: '<script src="/{{filePath}}"></script>'.replace(/\.\.\/public/gi, ''),
    css: '<link rel="stylesheet" href="/{{filePath}}" />'.replace(/\.\.\/public/gi, '')
}
Run Code Online (Sandbox Code Playgroud)

但它似乎{{filePath}}在以后被替换,因此RegEx不会产生预期的结果.

处理这种情况的理想方法是什么?

gruntjs bower bower-install grunt-wiredep wiredep

11
推荐指数
2
解决办法
7189
查看次数

grunt-wiredep在具有不同依赖关系的多个文件上

目前的项目结构有点像这样:

-index.html
|
-bower.json
|
+-bower_components
Run Code Online (Sandbox Code Playgroud)

建议的项目结构将在项目根目录中添加一些静态html文件.到目前为止,我一直在管理bower.json中的所有前端依赖项,并使用grunt-wiredep任务将其自动包含在index.html中.但是添加新文件后,每个文件都会有不同的依赖关系.

-index.html
|
-file-with-some-other-bower-dependency.html
|
-bower.json
|
+bower_components
Run Code Online (Sandbox Code Playgroud)

使用不同的bower依赖关系管理这些文件的有效方法是什么?

gruntjs bower grunt-wiredep wiredep

10
推荐指数
1
解决办法
760
查看次数

Grunt wiredep没有注入字体 - 真棒

我目前正在开发一个已经开始使用的项目yeoman.

出于某种原因,当我运行grunt-wiredep所有依赖项时,我将注入相关的index.html除外font-awesome.

这是我的bower.json档案:

{
  "name": "watermelon",
  "version": "0.0.0",
  "dependencies": {
    "angular": "^1.3.0",
    "angular-animate": "^1.3.0",
    "angular-bootstrap": "~0.13.3",
    "angular-cookies": "^1.3.0",
    "angular-google-maps-native": "~2.0.0",
    "angular-mocks": "~1.3.0",
    "angular-resource": "^1.3.0",
    "angular-route": "^1.3.0",
    "angular-sanitize": "^1.3.0",
    "angular-scenario": "~1.3.0",
    "angular-touch": "^1.3.0",
    "angular-ui-router": "~0.2.15",
    "bootstrap": "^3.2.0",
    "bootstrap-switch": "~3.3.2",
    "eonasdan-bootstrap-datetimepicker": "~4.15.35",
    "es5-shim": "^4.0.0",
    "font-awesome": "~4.4.0",
    "json3": "^3.3.0",
    "moment": "~2.10.6",
    "ng-tags-input": "3.0.0",
    "requirejs": "latest",
    "requirejs-domready": "latest",
    "stacktrace-js": "~0.6.4",
    "underscore": "~1.8.3"
  },
  "appPath": "."
}
Run Code Online (Sandbox Code Playgroud)

并链接到Gruntfile.js:http://pastebin.com/xxZwAYRW

当我grunt-wiredep …

javascript font-awesome bower grunt-wiredep

9
推荐指数
2
解决办法
4282
查看次数

yeoman grunt-wiredep没有注入依赖项

运行"wiredep:target"(wiredep)任务

完成,没有错误

但不注入bower.json的依赖项.无法调试此问题.任何帮助表示赞赏.

Gruntfile.js:

wiredep: {

        target: {

            // Point to the files that should be updated when
            // you run `grunt wiredep`
            src: [
                '<%= yeoman.app %>/index.html'
            ],
            // Optional:
            // ---------
            options: {
                cwd: '',
                dependencies: true,
                devDependencies: false,
                exclude: [],
                fileTypes: {},
                ignorePath: '',
                overrides: {}
            }
        }
    },
Run Code Online (Sandbox Code Playgroud)

gruntjs yeoman grunt-wiredep wiredep

8
推荐指数
1
解决办法
4389
查看次数

grunt-wiredep不会在lib文件夹名称中使用点注入js libs

执行时grunt-wiredep

grunt wiredep:目标

任务返回:

leaflet.markercluster was not injected in your file.
Please go take a look in "/home/rd/java/workspace/test-express/bower_components/leaflet.markercluster" for the file you need, then manually include it in your file.
Run Code Online (Sandbox Code Playgroud)

对于文件夹名称中带点的其他库,行为也相同.其他库正确地注入到hmtl和jade文件中.这个问题有解决方法吗?

javascript node.js gruntjs grunt-wiredep

5
推荐指数
0
解决办法
400
查看次数