sapegin / grunt-webfont

SVG to webfont converter for Grunt
MIT License
1.11k stars 210 forks source link

generate two stylesheets with different templates #395

Open zypA13510 opened 5 years ago

zypA13510 commented 5 years ago

This used to work in v1.4.0, now(v1.7.2) it will only generate one file, whichever run last, i.e. if webfont:css is run, it will clean up the scss file and generate a css file, vice versa for webfont:scss. I want to keep both the scss file and the css.

Gruntfile.js:

module.exports = function(grunt) {
  grunt.initConfig({
    webfont: {
      options: {
        ...
      },
      css: {
        src: 'svg/*.svg',
        dest: 'build',
        options: {
          template: 'lib/template.css',
        },
      },
      scss: {
        src: 'svg/*.svg',
        dest: 'build',
        options: {
          stylesheet: 'scss',
          template: 'lib/template.scss',
        },
      },
    },

    clean: ['build/*'],
  })

  grunt.loadNpmTasks('grunt-contrib-clean')
  grunt.loadNpmTasks('grunt-webfont')

  grunt.registerTask('build', ['clean', 'webfont'])
}
zypA13510 commented 5 years ago

I think #349 breaks this. v1.5.0 is fine and v1.6.0 becomes broken.

zypA13510 commented 5 years ago

The way I see it, either we add a lot of template options, e.g. templateCss, templateScss, like what has been done for destCss, or roll back the change. Both of which should be considered to be "breaking" (one breaks v1.5 while the other breaks v1.6-v1.7) and should probably be released as v2. Either way, I will stick to v1.5 for the time being.