# smallmina-loader

> 一个小程序预编译loader，基于wechat-mina-loader改造

Latest version **0.0.8** (published 2019-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install smallmina-loader
pnpm add smallmina-loader
yarn add smallmina-loader
bun add smallmina-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2019-08-09 |
| First published | 2019-05-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 16 |
| Unpacked size | 89.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | minzhang |
| Maintainers | zm569835014 |
| Keywords | mina-loader |

## Links

- npm: https://www.npmjs.com/package/smallmina-loader
- npm.io page: https://npm.io/package/smallmina-loader

## Dependencies (16)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [stylus](https://npm.io/package/stylus.md) ^0.54.5
- [fs-extra](https://npm.io/package/fs-extra.md) ^3.0.1
- [babel-core](https://npm.io/package/babel-core.md) ^6.24.1
- [typescript](https://npm.io/package/typescript.md) ^3.5.3
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.5.4
- [consolidate](https://npm.io/package/consolidate.md) ^0.14.5
- [loader-utils](https://npm.io/package/loader-utils.md) ^1.1.0
- [stylus-loader](https://npm.io/package/stylus-loader.md) ^3.0.2
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.5.4
- [vue-template-compiler](https://npm.io/package/vue-template-compiler.md) ^2.3.3
- [@babel/runtime-corejs2](https://npm.io/package/@babel/runtime-corejs2.md) ^7.5.4
- [@babel/preset-typescript](https://npm.io/package/@babel/preset-typescript.md) ^7.3.3
- [@babel/plugin-transform-runtime](https://npm.io/package/@babel/plugin-transform-runtime.md) ^7.5.0
- [@babel/plugin-proposal-class-properties](https://npm.io/package/@babel/plugin-proposal-class-properties.md) ^7.5.5
- [@babel/plugin-proposal-object-rest-spread](https://npm.io/package/@babel/plugin-proposal-object-rest-spread.md) ^7.5.5

## Recent versions

- 0.0.8 (latest) — 2019-08-09
- 0.0.7 — 2019-08-07
- 0.0.6 — 2019-06-12
- 0.0.5 — 2019-06-12
- 0.0.4 — 2019-06-12
- 0.0.3 — 2019-05-21
- 0.0.2 — 2019-05-21
- 0.0.1 — 2019-05-21

## README

# 一个微信小程序的编译器
----

## 安装
```
npm install smallmina-loader

```

## webpack.config
```javascript
module.exports = {
  module: {
    rules: [
      {
        test: /\.mina$/,
        loader: 'smallmina-loader',
        options:{
            //开发的源文件夹
             source: 'src',
             //编译后的文件交和原文件同目录
             target: 'build',
             //指定文件夹
             dist: '',
             //指定扩展名
             extension: {
                 style: 'acss',
                 template: 'axml'
             }
        }
      }
    ]
  }
}
```

## 使用方式

### 最简单的姿势



```
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 即可

---
_Source: https://npm.io/package/smallmina-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
