簡體   English   中英

如何合並文件而不使用grunt縮小文件

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

我有以下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']);

};

今天才剛開始使用grunt.js,只是看了看文檔和示例,我正在使用以下插件:

CSS-CONTRIB-MIN

現在,我的文件被最小化為一個,但是我真正想要的是將它們僅合並為一個,而不是最小化。 我該如何實現?

您應該使用grunt-contrib-concat插件執行此任務。 仔細查看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