Change bundle limits and build script

This commit is contained in:
Rubikscraft
2022-12-27 16:56:59 +01:00
parent 5a6a366f9d
commit 40bd2349a3
5 changed files with 160 additions and 16 deletions

View File

@@ -21,7 +21,7 @@
"sourceRoot": "src",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
@@ -42,18 +42,22 @@
"allowedCommonJsDependencies": [
"ngx-auto-unsubscribe-decorator",
"moment",
"platform"
"platform",
"form-data"
],
"optimization": true,
"webWorkerTsConfig": "tsconfig.worker.json"
"webWorkerTsConfig": "tsconfig.worker.json",
"customWebpackConfig": {
"path": "./custom-webpack.config.js"
}
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
"maximumWarning": "1mb",
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",

View File

@@ -1,5 +1,9 @@
import webpack from 'webpack';
// import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
export default {
plugins: [new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en/)],
plugins: [
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en/),
// new BundleAnalyzerPlugin(),
],
};

View File

@@ -14,6 +14,7 @@
"purge": "rm -rf dist && rm -rf node_modules && rm -rf .angular"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^15.0.0",
"@angular-devkit/build-angular": "^15.0.4",
"@angular/animations": "^15.0.4",
"@angular/cdk": "^15.0.3",
@@ -53,6 +54,7 @@
"rxjs": "^7.8.0",
"tslib": "^2.4.1",
"typescript": "^4.9.4",
"webpack-bundle-analyzer": "^4.7.0",
"zod": "^3.20.2",
"zone.js": "^0.12.0"
}