Skip to content

Commit

Permalink
fix(stark-build): remove support for obsolete webpack-monitor
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
  Due to Angular upgrade, webpack-monitor stopped working. Since the package was no longer maintained (4 years),
  we decided to remove the support from `stark-build`.

  The following scripts should be removed from "package.json" file:

  ```json
  {
    "scripts": {
      "build:dev:monitor": "npx mkdirp reports && cross-env MONITOR=1 npm run build:dev",
      "server:dev:monitor": "npm run clean:dist && cross-env MONITOR=1 npm run ng -- serve",
      "start:monitor": "npx mkdirp reports && cross-env MONITOR=1 npm run server:dev"
    }
  }
  ```
  • Loading branch information
SuperITMan committed Jun 8, 2021
1 parent df5bed4 commit 095117c
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 3,593 deletions.
19 changes: 19 additions & 0 deletions docs/MIGRATION_GUIDE_STARK_11.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,25 @@ Thanks to the following search & replace:

It should be easy to adapt the index.html file.

### 3. Adapt "package.json" file

#### 3.1 Remove scripts with MONITOR

Due to Angular upgrade, webpack-monitor stopped working. Since the package was no longer maintained (4 years),
we decided to remove the support from `stark-build`.

The following scripts should be removed from "package.json" file:

```json
{
"scripts": {
"build:dev:monitor": "npx mkdirp reports && cross-env MONITOR=1 npm run build:dev",
"server:dev:monitor": "npm run clean:dist && cross-env MONITOR=1 npm run ng -- serve",
"start:monitor": "npx mkdirp reports && cross-env MONITOR=1 npm run server:dev"
}
}
```

## Stark-Core

### 1. UI-router changes
Expand Down
17 changes: 0 additions & 17 deletions docs/stark-build/NG_CLI_BUILD_CUSTOMIZATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,23 +293,6 @@ that will be included in the bundles: `de`, `fr`, `en-gb`, `nl` and `nl-be`.

This is needed because MomentJS package provides all locales available without the possibility to select only some of them.

#### [WebpackMonitor](https://github.com/webpackmonitor/webpackmonitor)

Gives information about the bundle's size. This plugin is not enabled by default in Stark-Build so you need to pass the environment variable `MONITOR=1` to enable it.

You can do this by setting the environment variable yourself before running the `ng serve` command or you can use [cross-env](https://github.com/kentcdodds/cross-env) and use it in an NPM script to set
the environment variable temporarily only for this command:

```text
"scripts": {
"serve:dev:monitor": "cross-env MONITOR=1 ng serve",
"serve:prod:monitor": "cross-env MONITOR=1 ng serve --prod=true",
}
```

The WebpackMonitor app (for example: http://webpackmonitor.com/demo.html) showing all the bundles relevant information will be served automatically on port 3030.
Also all the stats generated by WebpackMonitor will be available in a `stats.json` file under `reports/webpack-monitor`.

#### [BundleAnalyzerPlugin](https://github.com/webpack-contrib/webpack-bundle-analyzer)

Similar to WebpackMonitor, this plugin also gives information about the bundle's size with the difference that this is more interactive thanks to a zoomable tree map.
Expand Down

0 comments on commit 095117c

Please sign in to comment.