Transform wechat mini app components's wxml
npm install rollup-plugin-componentswxml -D
// rollup.config.js
import wxml from 'rollup-plugin-componentswxml';
export default {
input: 'src/components/custom-component/index.js',
plugins: [
wxml({
template: 'src/components/custom-component/index.wxml',
filename: 'index.axml',
dest: 'dist/cjs/components/custom-component',
platform: 'alipay'
})
],
output: [
{
file: 'dist/cjs/compoents/custom-component/index.js',
format: 'cjs',
},
],
}
template
type: string
filename
type: string
dest
type: string
platform
type: string
value: alipay
This option is used to determine the platform, default be wechat.