N
N
Nikita2018-10-05 16:21:28
gulp.js
Nikita, 2018-10-05 16:21:28

Source map for gulp, how to properly assemble less files in main.css to view sources in browser?

please help me write rules for gulp

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Matvey Phoenix, 2018-10-05
@nikitaaaz

An example with sass, for less everything is identical (well, almost).
1) We collected files from many into one via import https://github.com/mtvphnx/gulp-start/blob/master/...
2) We put them in the assembly https://www.npmjs.com/package/gulp -sourcemaps
3) We wrote const sourcemaps = require('gulp-sourcemaps') in the gulpfile and called the map entry in the task:

function имя_таска() {
    return gulp
        .src('путь_где_лежит_нужный_стиль.расширение')
        .pipe(sourcemaps.init())
        // тут что-то делаем
        .pipe(sourcemaps.write())
        .pipe(gulp.dest('путь_до_папки_куда_кидаем'));
}

- gulpfile example https://github.com/mtvphnx/gulp-start/blob/master/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question