Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cwd help #158

Open
davidrhoderick opened this issue Sep 28, 2016 · 3 comments
Open

cwd help #158

davidrhoderick opened this issue Sep 28, 2016 · 3 comments

Comments

@davidrhoderick
Copy link

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?

@FredLackeyOfficial
Copy link

@davidrhoderick Did you ever get this working? I just tried using cwd for the first time and it appears to do nothing. I'm curious if it works for anyone else.

@davidrhoderick
Copy link
Author

@SkydiverFL I haven't gotten it working yet. What version are you on? I'm using 2.0.0, but not much has changed regarding cwd usage.

@davidrhoderick
Copy link
Author

@SkydiverFL any updates from your end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants