0
0
00absolute_zero02022-01-24 09:26:41
css
00absolute_zero0, 2022-01-24 09:26:41

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);

61ee466db3fc4323861997.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman, 2022-01-24
@RomanTRS

The slash at the end of the path is not needed.

A
Alexander, 2022-01-24
@Aleksandr-JS-Developer

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 question

Ask a Question

731 491 924 answers to any question