Answer the question
In order to leave comments, you need to log in
Gulp doesn't create dist folder, What's the problem?
Hello please help gulp does not create dist. Copying files from src to dist does not work.
import * as nodePath from 'path';
const rootFolder = nodePath.basename(nodePath.resolve());
const buildFolder = './dist';
const srcFolder = './src';
export const path = {
build: {
files: '${buildFolder}/files/',
},
src: {
files: '${srcFolder}/files/**/*.*',
},
watch: {},
clean: buildFolder,
buildFolder: buildFolder,
srcFolder: srcFolder,
rootFolder: rootFolder,
ftp: '',
}
import gulp from "gulp";
import { path } from "./gulp/config/path.js";
global.app = {
path: path,
gulp: gulp
}
export const copy = () => {
return app.gulp.src(app.path.src.files)
.pipe(app.gulp.dest(app.path.build.files))
}
import { copy } from "./gulp/tasks/copy.js";
gulp.task('default', copy);
Answer the question
In order to leave comments, you need to log in
Of course it doesn't work - imports should be at the very top of the file. Before any code other than other imports.
You also have:
import * as nodePath from 'path';
// code...
export ...
import gulp from "gulp";
import { path } from "./gulp/config/path.js";
// code...
export ...
import { copy } from "./gulp/tasks/copy.js";
// code...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question