E
E
enchikiben2019-05-21 15:45:28
Angular
enchikiben, 2019-05-21 15:45:28

How to set before handle in ng serve Angular 7?

Good afternoon! Tell me how to expand or customize the ng serve server? I found the package https://github.com/manfredsteyer/ngx-build-plus Angular itself recommends it, they say you can change the parameters through it.
Added custom file:

"serve": {
          "builder": "ngx-build-plus:dev-server",
          "options": {
            "browserTarget": "frontend:build",
            "extraWebpackConfig": "./webpack.serve.extra.ts"
          },
          "configurations": {

          }
        },

in webpack.serve.extra.ts
console.log("webpack.serve.extra.js");

module.exports = {
  devServer: {
    before: function () {
      console.log(123123);
    },
    port: 9000
  }
};

everything starts in the console, the log is displayed, there are no errors, but the default port 4200 does not change to 9000, not to mention before.
Who did something like that?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question