Skip to content

directories with periods in names #583

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

Closed
harvellm opened this issue Sep 23, 2014 · 3 comments
Closed

directories with periods in names #583

harvellm opened this issue Sep 23, 2014 · 3 comments

Comments

@harvellm
Copy link

Hi,

I'm pretty new to grunt...so this might be easy, but I'll show you what I'm doing and maybe you can help.

Whenever I add a library via bower that has a period in the directory name, slick.js, lunr.js, animate.css, etc. I get a build error as the various build steps are attempting to operate on the directory instead of the file. So, I have gone into the gruntfile and added exclusions for these directories:

rev: {
dist: {
files: {
src: [
'<%= yeoman.dist %>/public/{,}/.js',
'<%= yeoman.dist %>/public/{,
}/lunr.js/.js',
'!<%= yeoman.dist %>/public/bower_components/lunr.js',
'<%= yeoman.dist %>/public/{,}/slick.js/.js',
'<%= yeoman.dist %>/public/{,
}/slick.js/__/.js',
'!<%= yeoman.dist %>/public/bower_components/slick.js',
'<%= yeoman.dist %>/public/{,/}.css',
'<%= yeoman.dist %>/public/assets/images/{,/}.{png,jpg,jpeg,gif,webp,svg}',
'<%= yeoman.dist %>/public/assets/fonts/*'
]
}
}
},

and,

usemin: {
  html: ['<%= yeoman.dist %>/public/{,*/}*.html'],
  css: ['<%= yeoman.dist %>/public/{,*/}*.css'],
  js: [
        '<%= yeoman.dist %>/public/{,*/}*.js',
        '<%= yeoman.dist %>/public/{,*}*/lunr.js/*.js',
        '!<%= yeoman.dist %>/public/bower_components/lunr.js',
        '<%= yeoman.dist %>/public/{,*}*/slick.js/*.js',
        '<%= yeoman.dist %>/public/{,*}*/slick.js/**/*.js',
        '!<%= yeoman.dist %>/public/bower_components/slick.js'
        ],
  options: {
    assetsDirs: [
      '<%= yeoman.dist %>/public',
      '<%= yeoman.dist %>/public/assets/images',
      '<%= yeoman.dist %>/public/assets/fonts',
      '<%= yeoman.dist %>/public/assets/artifacts'
    ],
    // This is so we update image references in our ng-templates
    patterns: {
      js: [
        [/(assets\/images\/.*?\.(?:gif|jpeg|jpg|png|webp|svg))/gm, 'Update the JS to reference our revved images']
      ]
    }
  }
},

This works, but I need to do it for every project and make it very specific to the project I'm including as you can see. Maybe I'm misunderstanding the globbing rules as I thought I could do it more generically but I have tried several things and none of them works...is there a way for me to make this more generic?

Also, at the same time I discovered this issue, I discovered that certain of these libraries, even after grunt will build them, fail to work after minified and concatenated. Select2, for instance, even once it was added to the exclusion list just as above does not work. Slick is another one. I just get an error about slick not being an object or the like. Is this related to what I'm talking about here or is it a problem with their libraries? If so, they provide a minified version - how do I use the minified version - the injector keeps overwriting my changes in the index.html file and I can't seem to get it to "stick."

I don't think this is a bug in your code but I've looked around and don't see any content on this subject so I think others must not be using libraries with periods in the name or I'm doing something really wrong.

thanks.

@JaKXz
Copy link
Collaborator

JaKXz commented Sep 25, 2014

I think this is a duplicate of #420 and #522.

@programming-kid
Copy link

no its not same as #420

@jamesr-rdm
Copy link

bower install animate-css --save

will grab animate.css but save at:

bower_components/animate-css

Problem solved

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

No branches or pull requests

4 participants