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

Files are accidentally combined when ext is defined #341

Open
helgatheviking opened this issue Jun 30, 2015 · 3 comments
Open

Files are accidentally combined when ext is defined #341

helgatheviking opened this issue Jun 30, 2015 · 3 comments

Comments

@helgatheviking
Copy link

helgatheviking commented Jun 30, 2015

When I try to find use the bit of code from the readme to dynamically uglify all the files in a folder:

// Project configuration.
grunt.initConfig({
  uglify: {
    my_target: {
      files: [{
          expand: true,
          cwd: 'src/js',
          src: '**/*.js',
          ext: '.min.js',
          dest: 'dest/js'
      }]
    }
  }
});

If the filenames have . in them uglify gets confused and concatenates files. For example: I have jquery.fitvids.js and jquery.fastclick.js and after running the uglify from above I end up only with jquery.min.js. However, if I drop the ext setting then I get 3 files as expected.

@helgatheviking helgatheviking changed the title Files are accidentally combined when ext option Files are accidentally combined when ext is defined Jun 30, 2015
@gothburz
Copy link

gothburz commented Jul 1, 2015

I replicated your problem and has the same issue, it only worked correctly when I renamed the files without "jquery.". Just leave the files as .js extensions.

@helgatheviking
Copy link
Author

Yes, it works when I rename the files to remove the "jquery". I think it would be ideal for the grunt plugin to get the file name from whatever preceeds .js instead of first character up until the first .

@XhmikosR
Copy link
Member

You are welcome to make a PR.

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

3 participants