fis3-prepackager-replace-attr
v0.1.3
Published
a prepackager plugin for fis3
Downloads
3
Maintainers
Readme
fis3-prepackager-replace-attr
a prepackager plugin for fis3 在 prepackager 阶段,把文件进行unicode编码
usage
install
npm install fis3-prepackager-replace-attr --save-dev
use
请在需要 replace-attr 的文件上加上 isHtmlLike 标记
// css 类型文件需要加 isCssLike 标记
fis.match('**.html', {
isHtmlLike : true
});
fis.match('::package', {
prepackager: fis.plugin('replace-attr', {
attr : ['data-img', 'data-url', 'data-path']
}, 'append')
});
Before
<a data-url='./html/demo.html'>demo</a>
<img data-img='./images/demo.png'>
After
<a data-url='http://xxx.com/xxxxx/html/demo.html'>demo</a> // release url
<img data-img='http://xxx.com/xxxxx/images/demo.png'>// release url