Skip to content

Commit

Permalink
docs(nebula-cli): run nebula cli commands with Node.js (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
LiKang6688 committed Sep 1, 2021
1 parent 210b672 commit f0678d2
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion commands/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ or
yarn add @nebula.js/cli @nebula.js/cli-build @nebula.js/cli-sense @nebula.js/cli-serve
```

Open up package.json, those dependencies are added in your package.json file.
Open up your package.json, those dependencies are added.

```json
{
Expand All @@ -63,6 +63,29 @@ and add a script like so:
},
```

You can also run nebula cli commands with Node.js. Create a js file called build.js
and add the following:

```js
const build = require('@nebula.js/cli-build');
const sense = require('@nebula.js/cli-sense');

await build({
config: '../nebula.config.js',
sourcemap: false,
core: 'core',
mode: 'production',
watch: false,
});
await sense({ output: 'sn-table-ext', sourcemap: true });
```

and run the following command:

```bash
node build.js
```

## How to test your modified nebula CLI locally and globally

Requirements:
Expand Down

0 comments on commit f0678d2

Please sign in to comment.