const scripts = () => {
return src('./src/js/main.js')
.pipe(webpackStream({
mode: 'development',
output: {
filename: 'main.js',
},
module: {
rules: [{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}]
},
}))
.on('error', function (err) {
console.error('WEBPACK ERROR', err);
this.emit('end'); // Don't stop the rest of the task
})
.pipe(sourcemaps.init())
.pipe(uglify().on("error", notify.onError()))
.pipe(sourcemaps.write('.'))
.pipe(dest('./build/js'))
.pipe(browserSync.stream());
}
mixin masonry-card(ClassName, dataCard, sticker)
- sticker.view = 'false'
.masonry-card(class= ClassName)
a.masonry-card__img-wrapper(href="#")
img.masonry-card__img(src="img/" + dataCard.img)
.masonry-card__info
if sticker.view == 'true'
include ../card-sticker/card-sticker
+card-sticker(sticker.class, sticker.text, sticker.mod)
a.masonry-card__title(href="#")= dataCard.title
a.masonry-card__author(href="#")= dataCard.author
span.masonry-card__type Картина, 80x60 см.
.masonry-card__footer
.masonry-card__price= dataCard.price
<span class="masonry-card__price-rub">7</span>
.masonry-card__old-price= dataCard.oldPrice
mixin card-sticker(ClassName, text, mod)
span.card-sticker(class= ClassName.ClassName+'--'+mod)= text