From 9cbf98664b6004b67d350c0e30597043e7edc811 Mon Sep 17 00:00:00 2001 From: zhaoluming Date: Tue, 10 May 2016 16:39:22 +0800 Subject: [PATCH] add usage --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a82c4c5..b73861b 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,27 @@ # gulp-module-bundler A gulp plugin for bundle up the html files, css files and javascript file + 一个用来把html、css等文本文件打包放进js文件的gulp插件 ## Install npm install --save-dev gulp-module-bundler -## Usage +## Example +#### gulpfile.js var bundler = require('gulp-module-bundler'); gulp.task('module', function() { - return gulp.src('./lib/module.js') + return gulp.src('./module/module.js') .pipe(bundler()) .pipe(gulp.dest('./dist/')); }); + +#### module/module.js + const template = require("./template.ejs") + const style = require("./style.styl") + ... + +## Intro +样式和模板文件会以字符串的形式插入到js代码中的对应的位置 + +## Notice +Only support `.html` `ejs` `.styl` files now.