0.1.7 • Published 6 years ago

@funya._./gulp-wxapp-npm v0.1.7

Weekly downloads
7
License
ISC
Repository
-
Last release
6 years ago

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,
    })
  }
})