vm-render-loader

0.0.5 • Public • Published

desc

需求:webpack生成的html中若含有velociy语法,无法本地渲染。而devMiddleware不便于修改。

解决:利用loader给定json格式直出数据,输出渲染后的html

usage

    {
        test: /\.html$/,
        loader: 'vm-render-loader',
        options: {
            url: 'http://test.json'
        }
    }

demo

input: index.html

<html>
<body>
    <p>$!{test}</p>
</body>
</html>

options: url=http://test.json

{
    test: "hello world!"
}

output

<html>
<body>
    <p>hello world!</p>
</body>
</html>

Readme

Keywords

Package Sidebar

Install

npm i vm-render-loader

Weekly Downloads

0

Version

0.0.5

License

MIT

Unpacked Size

2.34 kB

Total Files

3

Last publish

Collaborators

  • liberalist