gulp-paths-to-file
v1.0.0
Published
Append/prepend transformed file paths to your files
Downloads
1
Readme
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'))
});