wxml-image-loader
v1.0.10
Published
```html <image src="{{require('../../images/joyrun.png')}}" /> ```
Downloads
2
Readme
支持在html引入静态资源,如下所示:
<image src="{{require('../../images/joyrun.png')}}" />
webpack配置如下:
module.exports = {
modules: {
rules: [
{
test: /[a-z-]+\.page\.html$/,
use: [
{
loader: require.resolve('file-loader'),
options: {
name: '[path]',
outputPath: wxml,
},
},
{
loader: require.resolve('wxml-image-loader'),
options: {
limit: 10000,
outputPath: '/statics/images/',
},
},
],
},
]
}
};