wechat-minap-loader

0.2.1 • Public • Published

一个微信小程序的编译器


安装

npm install wechat-minap-loader

webpack.config

module.exports = {
  module: {
    rules: [
      {
        test: /\.mina$/,
        loader: 'wechat-minap-loader'
      }
    ]
  }
}

使用方式

最简单的姿势

require('./pages/index/index.mina')

在 app.js 中项目中引入之后会在根目录的 dist 文件夹下生成两份文件分别为

/pages/index/index.wxml
/pages/index/index.wxss

比起返回 babel 转换过的 script 标签中的内容

关于语法

由于使用的是 vue-template-compiler 进行解析,所以语法基本与 vue-loader,相同

比如你想用 pug,那么在 template 标签中加入 lang="pug" 即可

高亮设置

将高亮设置为 vuecomponent 即可

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.2.13latest

Version History

VersionDownloads (Last 7 Days)Published
0.2.13
0.2.00
0.1.90
0.1.80
0.1.70
0.1.61
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.31
0.0.20
0.0.10

Package Sidebar

Install

npm i wechat-minap-loader

Weekly Downloads

2

Version

0.2.1

License

MIT

Unpacked Size

37 kB

Total Files

9

Last publish

Collaborators

  • goldweet