Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Added option for prettify package.json #117

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ excludes | string[] | Glob patterns for excluded files. Defaults to `[]`.
appId | string | App identity URI. Defaults to `io.github.nwjs.${ name }`.
ffmpegIntegration | boolean | Whether to integrate `iteufel/nwjs-ffmpeg-prebuilt`. If `true`, you can NOT use symbols in `nwVersion`. Defaults to `false`.
strippedProperties | string[] | Properties to be stripped from `package.json`. Defaults to `[ 'scripts', 'devDependencies', 'build' ]`.
prettyPropertiesSpace | string or number | Prettify properties in `package.json`. A number is setups count of spaces, else - specifiied tab symbol. Defaults to `0`.


## build.win <- [WinConfig](../src/lib/config/WinConfig.ts)

Expand Down
2 changes: 1 addition & 1 deletion src/lib/Builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class Builder {
}
}

await writeFile(path, JSON.stringify(json));
await writeFile(path, JSON.stringify(json, null, config.prettyPropertiesSpace));

}

Expand Down
1 change: 1 addition & 0 deletions src/lib/config/BuildConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class BuildConfig {
public appId: string = undefined;
public ffmpegIntegration: boolean = false;
public strippedProperties: string[] = [ 'scripts', 'devDependencies', 'build' ];
public prettyPropertiesSpace: string | number = 0;

constructor(pkg: any = {}) {

Expand Down