This project serves as a simple example of how to get webpack-dashboard
running with Angular CLI >= @6 without ejecting.
The workflow takes advantage of Angular 6 builders to inject the necessary config to load webpack-dashboard
. You can follow this article or read the steps below.
npm install -g @angular/cli
ng new angular-webpack-dashboard
cd angular-webpack-dashboard
npm i -D @angular-builders/custom-webpack
"architect": {
...
"build": {
"builder": "@angular-builders/custom-webpack:browser"
"options": {
...
}
...
}
"architect": {
...
"build": {
"builder": "@angular-builders/custom-webpack:browser"
"options": {
"customWebpackConfig": {
"path": "./extra-webpack.config.js"
}
...
}
...
}
npm i -D webpack-dashboard
const DashboardPlugin = require("webpack-dashboard/plugin");
module.exports = {
plugins: [new DashboardPlugin()]
};
npm i -D @angular-builders/dev-server
Then, in angular.json
:
"serve": {
"builder": "@angular-builders/dev-server:generic",
...
}
"scripts": {
"ng": "ng",
"start": "webpack-dashboard -- ng serve",
...
}