Socket
Socket
Sign inDemoInstall

gulp-preprocess-file

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gulp-preprocess-file

A Gulp plugin for Preprocess files based off environment configuration. Based on Preprocess package


Version published
Weekly downloads
8
increased by300%
Maintainers
1
Install size
3.27 kB
Created
Weekly downloads
 

Readme

Source

gulp-preprocess-file

A Gulp plugin for Preprocess files based off environment configuration. Based on Preprocess package

Usage

Install

Use npm.

$ npm install --save-dev gulp-preprocess-file

Examples

Gulpfile

var preprocess = require('gulp-preprocess-file');
 
gulp.task('html', function() {
  gulp.src('./src/*.html')
    .pipe(preprocess({
      context: {
        NODE_ENV: 'production',
        title: 'Hello gulp'
      }
    }))
    .pipe(gulp.dest('./dist/'))
});

html file

<body>

  <h1><!-- @echo title --></h1>
  <!-- @include ./includes/text.html -->

  <!-- @if NODE_ENV='production' -->
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script>
  <!-- @endif -->
  <script>
  var title = '<!-- @echo title -->' || 'Default'
  </script>
</body>

more: preprocess

License

gulp-preprocess-file Based on Preprocess package

MIT © Mervin

Keywords

FAQs

Last updated on 06 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc