Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gulp.task('styles', () => {
return gulp.src('app/stylesheets/*.scss')
// .pipe($.plumber())
// .pipe($.sourcemaps.init())
.pipe(sass.sync({
outputStyle: 'expanded',
precision: 10,
includePaths: ['.']
}).on('error', sass.logError))
// .pipe($.autoprefixer({browsers: ['last 1 version']}))
// .pipe($.uncss({
// html: ['app/*.html']
// }))
// .pipe($.sourcemaps.write())
.pipe(gulp.dest('public/stylesheets'))
.pipe(bundle());
// .pipe(reload({stream: true}));
});
function css(version, compat) {
const prefixer = autoprefixer({ browsers: compat });
return gulp.src(src.common('popup', 'popup.scss'))
.pipe(sass({ includePaths: './node_modules' }).on('error', sass.logError))
.pipe(postcss([prefixer]))
.pipe(gulp.dest(dist[version]('popup')));
}
gulp.task('sass', () => {
return gulp.src('./scss/**/*.scss')
.pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError))
.pipe(autoprefixer())
.pipe(gulp.dest('./dist'));
})
gulp.task('scss_2_css', () => {
return gulp.src(path.s_sass + '**/*.scss')
.pipe(plumber())
.pipe(sass.sync().on('error', sass.logError))
.pipe(plumber.stop())
.pipe(postcss([ autoprefixer({ browsers: ['last 3 versions'] }) ]))
.pipe(gulp.dest(path.s_css));
});
export const sass = () =>
gulp
.src(distPath('scss/index.scss'))
.pipe(
gulpSass({
precision: 3,
includePaths: [paths.node_modules]
})
)
.pipe(gulpSass().on('error', gulpSass.logError))
.pipe(gulpPostcss([autoprefixer({ remove: false })]))
.pipe(
gulpRename(path => {
path.basename = MODULE_NAME + path.basename.substring('index'.length);
path.extname = '.css';
return path;
})
)
.pipe(gulp.dest(distPath('assets/styles/')));
gulp.task('sass', () => {
return gulp.src(`${SRC_DIR}/static/sass/*.scss`)
.pipe(sass().on('error', sass.logError))
.pipe(cleanCSS())
.pipe(gulp.dest(`${BUILD_DIR}/styles`));
});
export const sassProd = () => src(`${pathSrc}${sassIndex}`)
.pipe(
sass({
includePaths: ['node_modules'],
}).on('error', sass.logError),
)
.pipe(
autoprefixer({
browsers: ['last 2 versions'],
cascade: false,
}),
)
.pipe(cleanCSS())
.pipe(concat('bundle.css'))
.pipe(dest(pathDest));
gulp.task('scss', () => gulp.src(paths.styles)
.pipe(sass(sassConfig).on('error', sass.logError))
.pipe(gulp.dest('dist/assets')))