0

My project folder looks like this:

project
__src
____main
______webapp
________WEB-INF
__________app
____________components
            //Angular files here.

I have a grunt task with ng-annotate with this configuration:

 ngAnnotate: {
      options: {
          singleQuotes: true
      },
      app: {
          files: [{
                expand: true,
                src: 'src/main/webapp/WEB-INF/app/components/**/*.js',
                ext: '.safe.js',
                dest: 'src/main/webapp/WEB-INF/app/min',
                extDot: 'last'
          }]
      }
  },

I want all the annotated files in the folder "src/main/webapp/WEB-INF/app/min", all togethers.

My problem is that grunt task create the whole rout to the file inside "min" folder I mind:

I hava a file in src/main/webapp/WEB-INF/app/components/module/module.js I want that file in src/main/webapp/WEB-INF/app/min/module.safe.js

But i'm getting src/main/webapp/WEB-INF/app/min/src/main/webapp/WEB-INF/app/components/module/module.safe.js

How can i make this task without create the whole path??

Padron Leandro
  • 313
  • 1
  • 4
  • 16

1 Answers1

0

I finally solved it with cwd command, so.

ngAnnotate: {
      options: {
          singleQuotes: true
      },
      app: {
          files: [{
                expand: true,
                cwd: 'src/main/webapp/WEB-INF/app/components/',
                src: ['**/*.js', '**/*.js', '!**/min/*', '!**/min-app/*'],
                ext: '.safe.js',
                dest: 'src/main/webapp/WEB-INF/app/min',
                extDot: 'last'
          }]
      }
  },

cwd is the route to the source path. Src will only take the javascript name.

Padron Leandro
  • 313
  • 1
  • 4
  • 16