npm install vite-plugin-mpx -D
// vite.config.js
import mpx from 'vite-plugin-mpx'
export default {
plugins: [mpx()],
resolve: {
extensions: ['.mpx', '.mjs', '.js', '.ts', '.jsx', '.tsx', '.json']
},
// If you used `swiper`, please include lodash/throttle
// https://vitejs.dev/config/#optimizedeps-exclude
optimizeDeps: {
include: ['lodash/throttle']
}
}
import Vue from 'vue'
import App from './app.mpx'
new Vue({
el: '#app',
render: function (h) {
return h(App)
}
})