Answer the question
In order to leave comments, you need to log in
How to move gulpfile.js to a directory?
Set up gulpfile.js to be at the root, and everything works:
example
--node_modules
--src
--file1.ext
--file2.ext
--file3.ext
--gulpfile.js
function clean() {
return del('dist')
}
function scss() {
const optSass = {
outputStyle: 'expanded',
includePaths: ['src'],
importer: tildeImporter
}
const optAutoprefixer = {
cascade: false
}
return src('./src/static/styles/styles.scss')
.pipe(sourcemaps.init())
.pipe(sass(optSass).on('error', sass.logError))
.pipe(groupMedia())
.pipe(autoprefixer(optAutoprefixer))
.pipe(sourcemaps.write('/'))
.pipe(dest('./dist/css/'))
}
const build = gulp.series(clean, scss)
exports.default = build
function clean() {
return del('../dist')
}
function scss() {
const optSass = {
outputStyle: 'expanded',
includePaths: ['src'],
importer: tildeImporter
}
const optAutoprefixer = {
cascade: false
}
return src('../src/static/styles/styles.scss')
.pipe(sourcemaps.init())
.pipe(sass(optSass).on('error', sass.logError))
.pipe(groupMedia())
.pipe(autoprefixer(optAutoprefixer))
.pipe(sourcemaps.write('/'))
.pipe(dest('../dist/css/'))
}
const build = gulp.series(clean, scss)
exports.default = build
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question