• grunt + compass


    compass和sass文章列表:http://182.92.240.72/tag/compass/ 

    compass实战grunt:

    http://wrox.cn/article/2000491/ 

    http://ju.outofmemory.cn/entry/73492

    http://ju.outofmemory.cn/entry/75413

    compass-demo/Gruntfile.js: https://github.com/minghe/compass-demo/blob/master/Gruntfile.js#L38

    module.exports = function (grunt) {
    
        grunt.initConfig({
            // 指定打包目录
            buildBase: 'build',
            //源码目录
            srcBase: 'src',
    
            clean: {
                build: [
                    '<%=buildBase %>'
                ]
            },
            copy: {
                all: {
                    files: [
                        {
                            expand: true,
                            cwd: '<%= srcBase %>',
                            src: ['**/*.css'],
                            dest: '<%=buildBase %>'
                        }
                    ]
                }
    
            },
            compass: {
                dist: {
                    options: {
                        sassDir: '<%= srcBase %>',
                        specify: '<%= srcBase %>/index.sass',
                        cssDir : '<%= srcBase %>',
                        assetCacheBuster: false
                    }
                },
                sprite: {
                    options: {
                        sassDir: '<%= srcBase %>',
                        specify: '<%= srcBase %>/sprite.sass',
                        cssDir : '<%= srcBase %>',
                        imagesDir: "<%= srcBase %>/images",
                        httpPath:"http://www.36ria.com/css",
                        assetCacheBuster: false
                    }
                },
                spriteX2: {
                    options: {
                        sassDir: '<%= srcBase %>',
                        specify: '<%= srcBase %>/sprite-x2.sass',
                        cssDir : '<%= srcBase %>',
                        imagesDir: "<%= srcBase %>/images",
                        assetCacheBuster: false
                    }
                }
            },
            cssmin: {
                build: {
                    expand: true,
                    cwd: '<%=buildBase %>',
                    src: ['**/*.css', '!**/*-min.css'],
                    dest: '<%=buildBase %>',
                    ext: '-min.css'
                }
            },
            watch: {
                options: {
                    livereload: true
                },
                compass: {
                    files: ['<%= srcBase %>/**/*.sass'],
                    tasks: ['compass']
                }
            }
        });
        /**
         * 载入使用到的通过NPM安装的模块
         */
        grunt.loadNpmTasks('grunt-contrib-clean');
        grunt.loadNpmTasks('grunt-contrib-copy');
        grunt.loadNpmTasks('grunt-contrib-cssmin');
        grunt.loadNpmTasks('grunt-contrib-watch');
        grunt.loadNpmTasks('grunt-contrib-compass');
    
        grunt.registerTask('default', ['clean','compass','copy:all','cssmin:build']);
        grunt.registerTask('dev', ['watch']);
        grunt.registerTask('sprite', ['compass:spriteX2']);
    
    };
    

      

  • 相关阅读:
    Oracle ROWID格式及rdba
    Solaris10上配置log server
    Powerpath的IO路径工作模式
    hagui启动时报警VRTSjre15: not found
    stty设置终端参数
    Jumpstart安装报错:Warning: Could not find matching rule in rules.ok
    解决xmanager无法连接Solaris10的问题
    Solaris10下syslogng安装配置
    VS2005 常用的快捷键
    物理路径和虚拟路径 的访问
  • 原文地址:https://www.cnblogs.com/ayseeing/p/4435296.html
Copyright © 2020-2023  润新知