|
2 | 2 |
|
3 | 3 | Building widgets with rolldown |
4 | 4 |
|
| 5 | +> NOTE: This tool in alpha |
| 6 | +
|
| 7 | +## Getting started |
| 8 | + |
| 9 | +### 1. Create tarball |
| 10 | + |
| 11 | +Let's assume you cloned this repo to `~/code/widgets-tools` |
| 12 | + |
| 13 | +1. `$ cd ~/code/widgets-tools/packages/mpx` |
| 14 | +2. `$ pnpm install` |
| 15 | +3. `$ pnpm pack` to create tarball |
| 16 | + |
| 17 | +### 2. Install to widget |
| 18 | + |
| 19 | +with `npm` |
| 20 | + |
| 21 | +> `$ npm install ~/code/mpx/mendix-mpx-0-y-z.tgz` |
| 22 | +
|
| 23 | +with `pnpm` |
| 24 | + |
| 25 | +> `pnpm install <path>/mpx/mendix-mpx-0-y-z.tgz` |
| 26 | +
|
| 27 | +### 3. Change scripts |
| 28 | + |
| 29 | +In your `package.json` |
| 30 | + |
| 31 | +```diff |
| 32 | +- "build": "pluggable-widgets-tools build:web" |
| 33 | ++ "build": "mpx" |
| 34 | +``` |
| 35 | + |
| 36 | +and |
| 37 | + |
| 38 | +```diff |
| 39 | +- "start": "pluggable-widgets-tools start:server" |
| 40 | ++ "start": "mpx -w" |
| 41 | +``` |
| 42 | + |
| 43 | +## Usage |
| 44 | + |
5 | 45 | ``` |
6 | 46 | mpx/0.1.0 |
7 | 47 |
|
8 | 48 | Usage: |
9 | | - $ mpx <command> [options] |
10 | | -
|
11 | | -Commands: |
12 | | - build [root] Build widget |
| 49 | + $ mpx [options] [dir] |
13 | 50 |
|
14 | | -For more info, run any command with the `--help` flag: |
15 | | - $ mpx build --help |
| 51 | +Build the widget in the specified directory. If the directory is omitted, use the current directory. |
16 | 52 |
|
17 | 53 | Options: |
18 | | - -h, --help Display this message |
19 | | - -v, --version Display version number |
20 | | -``` |
| 54 | + -w, --watch watch for changes and rebuild (default: false) |
| 55 | + -m, --minify minify the output (this option is 'on' in CI environment) (default: false) |
| 56 | + -p, --platform <platform> build platform (web or node) (default: web) |
| 57 | + --show-config print project config and exit (default: false) |
| 58 | + -h, --help Display this message |
| 59 | + -v, --version Display version number |
21 | 60 |
|
22 | 61 | ``` |
23 | | -TODO: |
24 | | -- MPKOUTPUT |
25 | | -- mpkName |
26 | | -`` |
27 | | -``` |
|
0 commit comments