zoukankan      html  css  js  c++  java
  • 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']);
    
    };
    

      

  • 相关阅读:
    设置IIS允许下载.config文件
    SQL Server 触发器
    MVC参数自动装配
    sql之left join、right join、inner join的区别
    C# 之泛型详解
    Frameset使用教程
    网页引用Font Awesome图标
    ubuntu下apache2 安装 配置 卸载 CGI设置 SSL设置
    深入理解JAVA I/O系列二:字节流详解
    深入理解JAVA I/O系列三:字符流详解
  • 原文地址:https://www.cnblogs.com/ayseeing/p/4435296.html
Copyright © 2011-2022 走看看