gulp-requirejs-replace-script
v1.0.3
Published
A plugin for Gulp to replace RequireJS script tags when using Almond
Downloads
3
Readme
gulp-requirejs-replace-script
Plugin for gulp to replace RequireJS includes with direct
<script>
tags for AlmondJS builds, like the replaceRequireScript functionality from grunt-requirejs.
Usage
First, install gulp-requirejs-replace-script
as a development dependency:
npm install --save-dev gulp-requirejs-replace-script
Then, add it to your gulpfile.js
:
var rjsReplace = require("gulp-requirejs-replace-script");
gulp.src("./client/src/index.html")
.pipe(rjsReplace([
'js/main'
]))
.pipe(gulp.dest("./client/dist"));
API
requirejs-replace-script(modules)
modules
Type: Array
An array of module names which should be included directly rather than via RequireJS's data-main
attribute.
If not provided, all Require tags will be replaced.