0

I would like to use the build task of the Gruntfile that is part of a yeoman angular-fullstack project. However I would like to have the JS code still readable and also want to avoid asset filenames to be renamed.

so far I changed the Gruntfile in the following:

  1. Change default flow behavior in useminPrepare

in gruntfile:

useminPrepare: {
  html: ['<%= yeoman.client %>/index.html'],
  options: {
    dest: '<%= yeoman.dist %>/public',

    // default flow behavior : https://github.com/yeoman/grunt-usemin#flow
    // change the default flow behavior
    flow: {
      steps: {
        js: ['concat'],
        css: ['concat']
      },
      post: {}
    }


  }
}
  1. Do not execute imagemin or svgmin

in gruntfile:

    concurrent: {
      // ...
      dist: [
        'sass',
        // 'imagemin',
        // 'svgmin'
      ]
    },
  1. Change build task

in gruntfile:

grunt.registerTask('build', [
    'clean:dist',
    'injector:sass',
    'concurrent:dist',
    'injector',
    'wiredep',
    'useminPrepare',
    'autoprefixer',
    'ngtemplates',
    'concat',
    'ngAnnotate',
    'copy:dist',
    'cdnify',
    //'cssmin',
    //'uglify',
    // 'rev',
    'usemin'
  ]);

When I build my project I see

  1. js code is now in all in app.js but readable so its fine
  2. assets/images is missing
  3. html partials are missing. Only the index.html is there

Can anyone help me set up a build process for the dist folder that still has the right file names for images and html and js code still readable ? The source files can be in one big file but they should still be readable.

JoachimR
  • 5,150
  • 7
  • 45
  • 50

1 Answers1

1

Add back the imagemin and svgmin-tasks, they just try to compress the images you use, they won't render your code unreadable.

Johannes Reuter
  • 3,501
  • 19
  • 20
  • Thanks you are right this was not part of my solution. But it doesn't solve the other problems though – JoachimR May 04 '15 at 11:11