0.0.2 • Published 10 years ago

gulp-cssabsoluteurl v0.0.2

Weekly downloads
6
License
-
Repository
-
Last release
10 years ago

grunt-cssAbsoluteURL

使用示例

grunt插件,用于将css中的相对路径转化为绝对路径。

配合mau插件,less配置rootpath时,将isAbsolute设置为true

gulp.task('less', function () {
    return gulp.src('src/**/*.less')
        .pipe(less({rootpath: 'src/page/list/'}))
        .pipe(mau({
            "whiteList": "img/(head\\/)?c-",
            "beautify": true,
            "model": "tfs",
            "server": {
                "name": "tfs",
                hashPath: path.resolve("./"),
                root: path.join(require("os").tmpdir(),"gulpimages"),
                tmp: path.join(require("os").tmpdir(),"gulpimages"),
                "cookie": "__utma=6906807.897471570.1391789127.1392873332.1393084750.6; __utmz=6906807.1391789127.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmv=6906807.|1=Browser%20CN=Chrome=1; miid=3605401251449851134; lzstat_uv=9575208883179742423|2738597@2758410@3097609@3222887@2244711@1296239@2225939@3414438@1544272@3415361@3415399; l=zhouqicf::1395729985164::11; ck1=; _m_h5_tk=c6b3f4da0de7f0c9c977feed4995ee3a_1396004756193; _m_h5_tk_enc=85203b3011000ba477d2c96dc8803543; mt=np=&ci=0_1&cyk=1_2; tg=0; cna=7qRsC+Ad+VECAXPBKyQanWGM; x=e%3D1%26p%3D*%26s%3D0%26c%3D0%26f%3D0%26g%3D0%26t%3D0%26__ll%3D-1%26_ato%3D0; lgc=zhouqicf; tracknick=zhouqicf; _cc_=UIHiLt3xSw%3D%3D; t=bcf98c9c57742550f70e5ce892af43e3; v=0; wud=wud; uc1=cookie14=UoLVYyEytWxhaQ%3D%3D; tms_SSO_TOKEN=C11C4930FFFD41E9D70164897E0833605A723CBF11E9AF7FC7271062CB3B424FF59EF6F5FE9197482C2AAA954887EC02; tms_LAST_HEART_BEAT_TIME=19A785BE65402BFC69113F360145F804; cmsTbToken=%2Cb7e3fd6e1991%2377290770699065935%2C004eed0853eb%2343771408845427202%2Cf357aea80d387%2344570474229472578%2Ce38373e37e387%2377293713085930935%2C557b7137e663%2377293714248469935%2C58367e345eb33%2377293717767554935%2Ced6786b35efd%2377293718984547935%2C3e373e33531da%2377293720410022935%2Ce3fde5b1beed6%2377293724529291935%2C7f3a13bf9bd3b%2313283455850734745",
                "inputUrl": "http://tps.tms.taobao.com/photo/index.htm",
                "uploadUrl": "http://tms.taobao.com/photo/upload.htm"
            }
        }))
        .pipe(cssTranseform({
            isAbsolute: true,
            "ignorePath": 'src/', // 忽略的文件路径
            "filepath": pkg.groupName + '/' +  pkg.name + '/' + pkg.version + '/' // 组名 + 包名 + 版本号
        }))
        .pipe(code.lint())
        .pipe(minify())
        .pipe(gulp.dest('build/'))
});