Giter Site home page Giter Site logo

mp-build's Introduction

使用gulp构建。stylus预处理、 bable es7,es6转es5、使用await、async接口请求封装

run

yarn run start

mp tools

编译后输出目录dist, 所以小程序开发工具指向的项目路径为 mp-build/dist



遇到的问题,使用gulp-clean插件清空dist文件报错。

解决方法

gulp->tasks里新建clean任务

var gulp = require('gulp');
var clean = require('gulp-clean');
var config = require('../config').clean;

gulp.task("clean", function(){
    return gulp.src(config.src)
        .pipe(clean());
})

同时在default任务序列里添加clean任务:

注意!下面这样是错误的: 因为这样写,这些任务是同步的,完全可能出现边编译边删除的情况

gulp.task('default', ['clean', 'less', 'images', 'js', 'watch']);

所以需要配置一个异步,非常简单,加个回调:

var gulp = require('gulp');

gulp.task('default', ['clean'], function(){
    gulp.start('less', 'images', 'js', 'watch');
});

参考内容: https://www.cnblogs.com/1wen/p/4586198.html



组件编写

参考内容: https://github.com/TalkingData/iview-weapp



ES7、ES6 转 ES5



mp-build's People

Contributors

wukuy avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.