G
G
George2017-01-15 21:37:17
JavaScript
George, 2017-01-15 21:37:17

How to split pages(html, scss) into folders in GULP?

How to build GULP so that each page (html, scss) is in a separate folder

  • app

    • page
      • index
        • index.html
        • index.scss

      • about
        • about.html
        • about.scss

      • ...



  • dist
    • ...

// ======================
// HTML
// ======================
gulp.task('html', function() {
return gulp.src(['app/page/**/*.html', '!app/page/__block/*.html'])
    .pipe(filesize())
    .pipe(plumber())
    .pipe(fileinclude({
        prefix: '@@',
        basepath: '@file'
    }))
    .pipe(notify("Found file: <%= file.relative %>!"))
    .pipe(gulp.dest('app/html/'))
    .pipe(reload({ stream:true }));
});
// ======================
// ======================

When the task is launched, an index and about folder is created in the app folder with index.html and about.html
How to make sure that only index.html and about.html are created in the dist folder?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zooks, 2017-01-15
@zooks

The .scss file must be shared across all pages. And lie along the path app/sass/
Then there will be no need to pervert with the paths.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question