Skip to content

cwd help #158

Open
Open
@davidrhoderick

Description

@davidrhoderick

I posted this in wiredep but maybe it is more specific to grunt-wiredep:

So I'm trying to clean up my application structure by putting bower_components in a vendor folder like this:

project
|-app
||-vendor
|||-bower_components

Inside my vendor folder, I have the bower.json and the .bowerrc files, and I've installed all my dependencies. I'm basing my wiredep code off of an Angular Yeoman generator, so maybe I'm messing it up a bit but it looks like this now:

// Automatically inject Bower components into the app
    wiredep: {
      app: {
        bowerJson: require('./vendor/bower.json'),
        directory: './vendor/bower_components',
        cwd: 'vendor',
        src: ['<%= yeoman.app %>/index.html'],
        ignorePath:  /\.\.\//
      },
      test: {
        bowerJson: require('./vendor/bower.json'),
        directory: './vendor/bower_components',
        cwd: 'vendor',
        devDependencies: true,
        src: '<%= karma.unit.configFile %>',
        ignorePath:  /\.\.\//,
        fileTypes:{
          js: {
            block: /(([\s\t]*)\/{2}\s*?bower:\s*?(\S*))(\n|\r|.)*?(\/{2}\s*endbower)/gi,
              detect: {
                js: /'(.*\.js)'/gi
              },
              replace: {
                js: '\'{{filePath}}\','
              }
            }
          }
      },
      sass: {
        bowerJson: require('./vendor/bower.json'),
        directory: './vendor/bower_components',
        cwd: 'vendor',
        src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        ignorePath: /(\.\.\/){1,2}bower_components\//
      }
    },

I added some configuration so that the bower.json and .bowerrc files would be found correctly inside the vendor folder because that was stopping grunt from running, but I'm now stuck on linking. When I run the serve task, which uses wiredep, the html is pointing to the vendor/bower_components/ folder for each dependency but not finding any of the files. I feel like maybe I messed something up, how do I fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions