UNPKG

angular-war-packager

Version:

Packages an Angular 18+ project into a WAR file with a web.xml.

96 lines (61 loc) β€’ 1.83 kB
# πŸ“¦ angular-war-packager Packages Angular applications (v18+) as `.war` files ready for Java EE servers, including an automatic `WEB-INF/web.xml`. --- ## πŸš€ Installation ### Global: ```bash npm install -g angular-war-packager ``` ### Or local (dev dependency): ```bash npm install --save-dev angular-war-packager ``` ### πŸ”½ Or download the `.tgz` package directly: [⬇️ Download angular-war-packager-x.x.x.tgz](https://github.com/darioajr/angular-war-packager/releases) --- ## βš™οΈ Usage ```bash npx ng-war ``` ### Full example: ```bash npx ng-war --output dist/myapp.war --context MyAngularApp --dist-folder dist ``` --- ## πŸ”§ Available options | Parameter | Description | |-----------------------|---------------------------------------------------------------------------| | `--output`, `-o` | Name of the generated WAR (default: `dist/app.war`) | | `--context`, `-c` | Context name used in `web.xml` (default: `AngularApp`) | | `--dist-folder`, `-d` | Path to the output folder from `ng build` (default: `dist/`) | --- ## πŸ“‚ Generated structure ``` dist/ └── app.war β”œβ”€β”€ index.html β”œβ”€β”€ assets/ └── WEB-INF/ └── web.xml ``` --- ## πŸ§ͺ Quick test ```bash ng new angular-war-test cd angular-war-test ng build npx ng-war ``` --- ## πŸ›‘οΈ Requirements - Node.js 16+ - Angular CLI with `ng build` executed --- ## 🧬 Automation with GitHub Actions This project can be published automatically to npm with a `v*` tag push. See the workflow at: ```yaml .github/workflows/publish-npm.yml ``` --- ## πŸ“„ License [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) Β©Dario Alves