Nukem's Possible Manifestation

    ngx-devkit-stubby-builder
    TypeScript icon, indicating that this package has built-in type declarations

    1.2.7 • Public • Published

    ngx-devkit-stubby-builder

    Greenkeeper badge

    Build Status NPM

    Builder architecture that use a Stubby server for handle http request when the Angular web application was serve using Angular >= 8 @angular-devkit/architect API.

    Install it

    npm install --save-dev ngx-devkit-stubby-builder
    

    Create Stubby configuration file

    Create ./stubs/config.json using the following documentation

    Add a new architecture task in your angular.json file

    {
        ...
        "projects": {
            "<app-target>": {
                "architect": {
                    ...
                    "serve": {
                        "builder": "@angular-devkit/build-angular:dev-server",
                        "options": {
                            "browserTarget": "web-app:build"
                        },
                        "configurations": {
                            "production": {
                            "browserTarget": "web-app:build:production"
                            }
                        }
                    },
                    "serve-with-stubs": {
                        "builder": "ngx-devkit-stubby-builder:serve",
                        "options": {
                            "devServerTarget": "web-app:serve",
                            "stubsConfigFile": "./stubs/config.json"
                        },
                        "configurations": {
                            "production": {
                            "devServerTarget": "web-app:serve:production"
                            }
                        }
                    },
                    ...
                }
            }
        }
    }

    Replace your npm start script in your package.json

        ...
        "scripts"{
            "ng": "ng",
            "start": "ng run <app-target>:serve-with-stubs",
        ...

    Note: Don't forget that <app-target> should be replaced with your unique target name. Example: "web-app", "my-app"

    Keywords

    none

    Install

    npm i ngx-devkit-stubby-builder

    DownloadsWeekly Downloads

    37

    Version

    1.2.7

    License

    MIT

    Unpacked Size

    18.3 kB

    Total Files

    11

    Last publish

    Collaborators

    • gpincheiraa