简体   繁体   English

如何合并文件而不使用grunt缩小文件

[英]How to combine file and not minify them using grunt

I have the following grunt file: 我有以下grunt文件:

module.exports = function(grunt) {

  grunt.initConfig({
    cssmin: {
      options: {
        shorthandCompacting: false,
        roundingPrecision: -1
      },
      target: {
        files: {
          'css/output.css': ['css/one.css', 'css/two.css']
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.registerTask('default', ['cssmin']);

};

just started using grunt.js today and just had a look at the documentation and the examples , i am using the following plugin: 今天才刚开始使用grunt.js,只是看了看文档和示例,我正在使用以下插件:

CSS-CONTRIB-MIN CSS-CONTRIB-MIN

Now, My files get minifined into one , but what i really want is for them to only be combined into one and not minified. 现在,我的文件被最小化为一个,但是我真正想要的是将它们仅合并为一个,而不是最小化。 how do i achieve that ? 我该如何实现?

You should use the grunt-contrib-concat plugin for this task. 您应该使用grunt-contrib-concat插件执行此任务。 Take a closer look at the GitHub documentation on how to configure the task (eg separator, banner, ...) 仔细查看GitHub文档,了解如何配置任务(例如,分隔符,横幅等)

grunt.initConfig({
  concat: {
    dist: {
      src: ['css/one.css', 'css/two.css'],
      dest: 'css/output.css',
    },
  },
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM