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

New files added to src are not detected #74

Open
startswithaj opened this issue Mar 25, 2015 · 5 comments
Open

New files added to src are not detected #74

startswithaj opened this issue Mar 25, 2015 · 5 comments

Comments

@startswithaj
Copy link

If you have a grunt task that has a src:[] of files and you add or remove a file from this array newer does not detect this change and run the respective grunt task this occurs on version 0.8.0.

Take for example;

 uglify:
      lib:
        src:[
          'bower_components/jquery/dist/jquery.js'
          'bower_components/lodash/dist/lodash.js'
          'bower_components/localforage/dist/localforage.js'
          'bower_components/angular/angular.js'
          'bower_components/angular-animate/angular-animate.js'
          'bower_components/angular-localforage/dist/angular-localForage.js'
        ]
        dest:'app/tmp/lib.js'

if you remove one of this files so the task looks like (remove localForage):

 uglify:
      lib:
        src:[
          'bower_components/jquery/dist/jquery.js'
          'bower_components/lodash/dist/lodash.js'
          'bower_components/localforage/dist/localforage.js'
          'bower_components/angular/angular.js'
          'bower_components/angular-animate/angular-animate.js'
        ]
        dest:'app/tmp/lib.js'

and run grunt newer:uglify:lib it will say No newer files to process. I would expect it to rebuild the lib.js without the file that has been removed from the list.
If you run this with the ---verbose the Files: output shows that localForgage file is not longer part of the src list but still does not initiate the task.

The same happens in reverse if for instance you add another file

 uglify:
      lib:
        src:[
          'bower_components/jquery/dist/jquery.js'
          'bower_components/lodash/dist/lodash.js'
          'bower_components/localforage/dist/localforage.js'
          'bower_components/angular/angular.js'
          'bower_components/angular-animate/angular-animate.js'
          'bower_components/angular-localforage/dist/angular-localForage.js'
          'bower_components/ng-simplePagination/simplePagination.js'
        ]
        dest:'app/tmp/lib.js'

When run with ---verbose the 'Files:' output includes simplePagination but it does not trigger the uglify task.

Am I missing something?

@jkudish
Copy link

jkudish commented Mar 25, 2015

I came here to report the same issue. Basically have an almost identical setup to yours @startswithaj

Let me know if I can provide anything useful from my setup.

@OwenMelbz
Copy link

bump

@tschaub
Copy link
Owner

tschaub commented Nov 10, 2015

The task works by comparing the mtime of source files to the mtime of the dest file(s). In the example you describe, none of the source files is newer than the dest file, so no work is done.

I'm not sure how you are removing one of your source files, but the way to trigger another build of the dest file would be to remove it as well.

@LeeJim
Copy link

LeeJim commented Aug 11, 2016

i know @startswithaj 's problem.because i have the same question.
if we have the source files like '/src' and the dest file '/dest',
when we modify some file in '/src', the newer task run correct,
but, when we add a new file in '/src', the newer task will not detected the new file change.

@mzentrale-htschurl
Copy link

+1, same problem.
Unfortunately, this greatly limits the usefulness of grunt-newer, at least in my case :/

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

6 participants