0

ライブラリ用に、次のCSS Source Mapファイルを生成しようとしています。gulp.jsBootstrapCSS

私のgulpタスクは次のとおりです。

bower = 'main-bower-files' が必要 sourcemaps = 'gulp-sourcemaps' が必要 cssmin = 'gulp-minify-css' が必要 gulpFilter = 'gulp-filter' が必要

gulp.task 'compileVendorLibraries', ->
    cssFilter = gulpFilter(['**/*.css'])
    gulp.src bower()
    .pipe cssFilter
    .pipe gulp.dest(dist.css + 'css')
    .pipe sourcemaps.init()
    .pipe rename({suffix: ".min"})
    .pipe cssmin()
    .pipe sourcemaps.write()
    .pipe cssFilter.restore()

そしてindex.html私は持っています:

<link href="app/stylesheets/css/bootstrap.min.css" rel="stylesheet" type="text/css">

ただし、Chromeで「元の」bootstrap.cssファイルを取得できません(ソースマップがアクティブになっています)

カスタム.lessファイルに対して次のように実行すると、元の「styles.less」ファイルが取得されます。

gulp.src sources.less
    .pipe sourcemaps.init()
    .pipe less()
    .on 'error', swallowError
    .pipe cssmin()
    .pipe sourcemaps.write()
    .pipe gulp.dest dist.css + 'css'
4

0 に答える 0