S
S
Spartacus2021-05-16 16:23:45
JavaScript
Spartacus, 2021-05-16 16:23:45

Gulp not adding slick.min.js file to dist folder?

Guys, I understand that I need to learn JS, but I haven’t grown up to it yet, so I ask you to help me a little here. The bottom line is, I add the slick.min.js file to #src , I run Gulp , it does not add this file to dist , and if I add this file to dist myself, gulp removes it from there and that's it. What should be written in gulpfile.js ? 60a11c56ddadc116198990.png
link to gulpfile.js if anyone wants to help https://disk.yandex.ru/d/nvT2SfsTvD4JhA

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
biz53, 2021-05-16
@biz53

As I understand it, slick is a library? If so, then you don’t need to put it in js, in such cases you need to add the lib folder and throw everything you need to use there, but you shouldn’t change it (you have a task that processes js files and changes them in its own way).
Step by step:
1. Create a lib folder in src, put a slick there.
2. Add to galp path

build: {
    lib: project_folder + "/lib",
  },
  src: {
    lib: source_folder + "/lib/*",
        }

3. Add task
function libraries() {
    return src(path.src.lib)
        .pipe(dest(path.build.lib))
}

4. Add a task to the line
let build = gulp.series(clean, gulp.parallel(js, css, html, images, fonts,lib), fontsStyle);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question