G
G
givrzn2017-03-15 14:40:47
css
givrzn, 2017-03-15 14:40:47

What is the correct file structure for a front-end project and why?

SUBJECT, correction: for a typesetter .
Actually, what should be in the project folder?
I am using gulp and local domain.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Antonov, 2017-03-15
@givrzn

  • dist
    src - folder with all layout sources (html, css, js, less, coffeescript, etc.),
    dist - folder of the working project compiled from the sources of the src folder, by command gulp,
    gulpfile.js - compilation script of the working project,
    package.json - project meta data and a list of required npm libraries for gulpfile.js to work,
    node_modules - third-party npm libraries installed for project compilation.
    gulpfile.js example:
    var gulp = require('gulp');
    var less = require('gulp-less');
    var cleanCSS = require('gulp-clean-css');
    
    gulp.task('default', function() {
        gulp.src('./src/css/**/*.less')
            .pipe(less())
            .pipe(cleanCSS())
            .pipe(gulp.dest('./dist/css/'))
        ;
    });

    For such a project, 3 npm libraries gulp, gulp-less, gulp-clean-css.
    This is a common skeleton for any gulp project. And the structure of the src folder is up to you. Everyone does it their own way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question