gulp-paths-to-file
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

gulp-paths-to-file

Append/prepend transformed file paths to your file contents. See below some usage instructions.

Installation

yarn add -D gulp-paths-to-file

Usage

import filePaths from 'gulp-paths-to-file';
import gulp from 'gulp';

gulp.task('stylesheets', () => {
    return gulp.src('./stylesheets/app.scss')
            .pipe(filePaths('./src/**/*.{css,scss}', (file) => `@import "${file}";`))
            .pipe(gulp.dest('public'))
});
import {FilePathsPlugin} from 'gulp-paths-to-file';
import gulp from 'gulp';

gulp.task('stylesheets', () => {
    return gulp.src('./stylesheets/app.scss')
            .pipe(new FilePathsPlugin({
                pattern: './node_modules/bootstrap/scss/**/*.{scss}',
                mode: 'prepend',
                getContent: (file) => `@import "${file}";`
            }))
            .pipe(new FilePathsPlugin({
                pattern: './src/**/*.{css,scss}',
                getContent: (file) => `@import "${file}";`
            }))
            .pipe(gulp.dest('public'))
});

Readme

Keywords

none

Package Sidebar

Install

npm i gulp-paths-to-file

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

22.1 kB

Total Files

10

Last publish

Collaborators

  • vqueiroz