gulp-wxapp-npm
gulp插件,解决微信小程序的npm包和babel-runtime的处理,修改于pandola
Install
$ npm install @funya._./gulp-wxapp-npm
Usage
const npm = require('@funya._./gulp-wxapp-npm')
gulp.src('src/**/*.js')
.pipe(npm())
src
import moment from 'moment';
import { request } from '../../utils';
Page({
async onLoad () {
const str = await Promise.resolve(request());
const time = moment().format();
wx.showToast({
title,
time,
})
}
})
dist
import regeneratorRuntime from '../../npm/regenerator-runtime/runtime-module.js'
import moment from '../../npm/moment/moment.js';
import { request } from '../../utils';
Page({
async onLoad () {
const str = await Promise.resolve(sayHello());
const time = moment().format()
wx.showToast({
title,
time,
})
}
})