gulp-normalize-html-for-require
v0.1.3
Published
Change async modules load to sync in browser.
Downloads
2
Readme
gulp-normalize-html-for-require
Change async modules load to sync in browser. Based ob gulp-decompress.
how to use
1. install
npm install --save gulp-normalize-html-for-require
2. use
var normalize = require("gulp-normalize-html-for-require");
normalize(options)
Example:
gulp.task("default", function () {
return gulp.src('path/to/html')
pipe(normalize({
baseUrl : './test/js/',
configFile: './test/js/common/config.js',
moduleName: 'test/index',
configFileTagSelector: '[data-require-config-tag]'
}))
.pipe(gulp.dest("./tmp"));
});
3. options
- baseUrl: base url of all js resources
- paths: module path declaration
- shim: modules shim
- configFile: require config file path
- moduleName: require module name
- configFileTagSelector: require config tag selector