const browser     = require('browser-sync');
const config      = require('../../config');
const gulp        = require('gulp');
const handleError = require('../../utilities/handleError');
const importer    = require('sass-module-importer');
const path        = require('path');
const sass        = require('gulp-sass');
const sourcemaps  = require('gulp-sourcemaps');

/**
 * HyperBolts ϟ (https://hyperbolts.io)
 *
 * Copyright © 2015-present Pace IT Systems Ltd.
 * All rights reserved.
 *
 * @author  Pace IT Systems Ltd
 * @license MIT
 */

module.exports = paths => () => gulp.src(paths.src)

    // Compile
    .pipe(sourcemaps.init())
    .pipe(sass({
        importer: importer({
            basedir: path.join(process.cwd(), 'node_modules')
        })
    }))
        .on('error', handleError)
    .pipe(sourcemaps.write())

    // Output
    .pipe(gulp.dest(
        path.resolve(config.base, paths.dest)
    ))

    // Reload browser
    .pipe(browser.reload({
        stream: true
    }));

const browser     = require('browser-sync');
const config      = require('../../config');
const gulp        = require('gulp');
const handleError = require('../../utilities/handleError');
const importer    = require('sass-module-importer');
const path        = require('path');
const sass        = require('gulp-sass');
const sourcemaps  = require('gulp-sourcemaps');

/**
 * HyperBolts ϟ (https://hyperbolts.io)
 *
 * Copyright © 2015-present Pace IT Systems Ltd.
 * All rights reserved.
 *
 * @author  Pace IT Systems Ltd
 * @license MIT
 */

module.exports = paths => () => gulp.src(paths.src)

    // Compile
    .pipe(sourcemaps.init())
    .pipe(sass({
        importer: importer({
            basedir: process.cwd()
        })
    }))
        .on('error', handleError)
    .pipe(sourcemaps.write())

    // Output
    .pipe(gulp.dest(
        path.resolve(config.base, paths.dest)
    ))

    // Reload browser
    .pipe(browser.reload({
        stream: true
    }));

Set sass base as root of project
Set sass base as root of project
