Answer the question
In order to leave comments, you need to log in
Is it correct to split js code into gulp like this?
In general, there is such a project structure:
src
--pages
----lk-index
----index
------index.js
------index.scss
------index.pug
--components
----footer
----header
------header.js
------header.scss
------header.pug
--static
----scripts
------scripts.js
index()
function index () {
}
header()
function header () {
}
const { src, dest } = require('gulp')
const concat = require('gulp-concat')
module.exports = function scripts () {
return src(['./app/pages/*/*.js', './app/components/*/*.js', './app/static/scripts/scripts.js'])
.pipe(concat())
.pipe(dest('dist/js'))
}
/* Очень много функций из компонентов и страниц */
index()
function index () {
}
header()
function header () {
}
/* Скрипты из самого файла scripts*/
alert('Hello world')
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