aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: c08aeddd2efeba9f822672f10eb4ec9c675e6d18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# wechat_dev_tools

Develop wechat miniprograms in [gleam](https://gleam.run).
It uses [esbuild]() and [esbuild-plugin-less]() to build `*.json`, `*.wxml` and `.wxss` files

```sh
$ git clone https://github.com/kaiwu/wechat_dev_tools.git your-project
$ cd your-project
$ npm install
$ gleam build
```

## Development

Update `src/bundle.gleam` so that it includes each one of your page and component

```gleam
pub fn pages() -> List(#(String, Constructor)) {
  [#("index", index.page)]
}

pub fn components() -> List(#(String, Constructor)) {
  [#("basic", basic.component)]
}
```

Npm scripts are provided for convenience

```sh
$ npm run purge
$ npm run clean
$ npm run build
$ npm run watch
```

One can use the excellent `watchexec` command to watch gleam file changes, such as

```sh
$ # a full continuous building process
$ watchexec -e gleam gleam build
$ npm run watch
```