gulp-js-inline-file
v1.0.0
Published
gulp plugn, inline file content into js
Readme
gulp-inline-file
通过__inline函数,在 JS 中直接引用其他文件的内容
效果
如a.css的内容是
body {
margin: 0;
padding: 0;
}
img {
border: 0;
}而a.js的内容是
var a = __inline('./a.css') // 填写相对目录即可经过转换之后,a.js的内容将变为
var a = 'body {\n margin: 0;\n padding: 0;\n}\nimg {\n border: 0;\n}'使用
参考链接
- http://www.gulpjs.com.cn/docs/writing-a-plugin/
- https://github.com/lazd/gulp-replace/blob/master/index.js
