Skip to content
mini-program template based on mpVue. 基于 mpVue 的小程序开发模板。
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build
config
src
static
.babelrc
.editorconfig
.eslintignore
.eslintrc.js
.gitignore
.postcssrc.js
README.md
package.json
package.swan.json
project.config.json
project.swan.json

README.md

命令

# 安装依赖
$ npm install

# 开发时构建
$ npm run dev

# 启动图片服务,请先将 http-server 安装到全局
$ cd cdn && http-server -p 88

# 打包构建
$ npm run build

# 指定平台的开发时构建(微信、百度、头条、支付宝)
$ npm dev:wx
$ npm dev:swan
$ npm dev:tt
$ npm dev:my

# 指定平台的打包构建
$ npm build:wx
$ npm build:swan
$ npm build:tt
$ npm build:my

优化开发体验

引入 mpvue-entry

# 安装
$ npm install --save-dev mpvue-entry@next
// webpack.base.conf.js
const MpvueEntry = require('mpvue-entry')

module.exports = {
  entry: MpvueEntry.getEntry('src/app.json'),
  ...
  plugins: [
    new MpvueEntry(),
    ...
  ]
}
// app.json - 支持 js 格式,兼容微信小程序官方配置规范
{
  "pages": [
    {
      "path": "pages/news/list",
      "config": {
        "navigationBarTitleText": "文章列表",
        "enablePullDownRefresh": true
      }
    }
  ],
  "window": {}
}

使用 Sass

# 安装
$ npm install --save node-sass sass-loader

参考

You can’t perform that action at this time.