"presets": ["es2015", "stage-0", "react"]
dataLayer[0].ecommerce.add.products.push({name:00; price:00});
dataLayer.forEach(function(el) {
el.ecommerce.add.products.push({name:00; price:00});
});
const gulp = require('gulp'),
path = require('path'),
sourcemaps = require('gulp-sourcemaps'),
uglify = require('gulp-uglify'),
autoprefixer = require('gulp-autoprefixer'),
sass = require('gulp-sass'),
globImport = require('gulp-sass-bulk-import'),
moduleImporter = require('sass-module-importer'),
cleanCSS = require('gulp-clean-css'),
glob = require('glob');
const paths = {
'styles': {
'src': './web/src/scss/*.scss',
'all': './web/src/scss/**/*.scss',
'dest': './web/css/'
}
};
gulp.task('sass:dev', () => {
gulp.src(paths.styles.src)
.pipe(sourcemaps.init())
.pipe(globImport())
.pipe(sass({ importer: moduleImporter() }).on('error', sass.logError))
.pipe(autoprefixer())
.pipe(cleanCSS({compatibility: 'ie11'}))
.pipe(sourcemaps.write('.', { sourceRoot: paths.styles.src }))
.pipe(gulp.dest(paths.styles.dest));
});
gulp.task('sass:prod', () => {
gulp.src(paths.styles.src)
.pipe(globImport())
.pipe(sass({ importer: moduleImporter() }).on('error', sass.logError))
.pipe(autoprefixer())
.pipe(cleanCSS({compatibility: 'ie11'}))
.pipe(gulp.dest(paths.styles.dest));
});
gulp.task('sass', ['sass:dev']);
gulp.task('watch:sass', () => gulp.watch(paths.styles.all, ['sass:dev']));
gulp.task('build:dev', [''sass:dev']);
gulp.task('build:prod', ['sass:prod']);
gulp.task('default', ['build:dev', 'watch']);
// ваши переменные
@import "config/bootstrap-variables";
// переменные bootstrap
@import "bootstrap/variables";
... // далее все, что хотите использовать из bootstrap
// ваши стили
@import "main";
webpack-dev-server --hot --history-api-fallback --open