JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8166
  • Score
    100M100P100Q121591F
  • License MIT

[WIP] A gulp plugin for wrapping your files with certain strings. Access to filename is given

Package Exports

  • gulp-wrapper

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-wrapper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gulp-wrapper

Build Status NPM version

Basically gulp-header & gulp-footer together. With the addition that the filename is revealed to the user.

So for example I can wrap an HTML file with <script> template tags and specify the filename id. ( I use it with angular so I can have regular HTML files in development, but make a bundle of all the templates in one HTML on production )

<div>
  my template HTML is here
</div>

so in my gulpfile.js I can do

...
var wrapper = require('gulp-wrapper');

...
gulp.src('template.html')
    .pipe(wrapper({
       header: '<script type="text/ng-template" id="${filename}">\n',
       footer: '</script>\n'
    }))
    .pipe(gulp.dest('out'));

the result is :

<script type="text/ng-template" id="template.html">
<div>
  my template HTML is here
</div>
</script>