diff --git a/docker/ci/entrypoint.sh b/docker/ci/entrypoint.sh index 6c41d9e9cdeb..d4dc280c9223 100755 --- a/docker/ci/entrypoint.sh +++ b/docker/ci/entrypoint.sh @@ -92,7 +92,7 @@ backend_stuff() { } frontend_stuff() { - execute_quiet "DATABASE_URL=nulldb://db time bin/rails openproject:plugins:register_frontend assets:precompile" + execute_quiet "OPENPROJECT_ANGULAR_BUILD=fast DATABASE_URL=nulldb://db time bin/rails openproject:plugins:register_frontend assets:precompile" execute_quiet "cp -rp config/frontend_assets.manifest.json public/assets/frontend_assets.manifest.json" } diff --git a/docker/pullpreview/docker-compose.yml b/docker/pullpreview/docker-compose.yml index 7c9664a60635..f6a3bb409c39 100644 --- a/docker/pullpreview/docker-compose.yml +++ b/docker/pullpreview/docker-compose.yml @@ -14,7 +14,7 @@ x-defaults: &defaults build: context: . args: - OPENPROJECT_ANGULAR_UGLIFY: "false" + OPENPROJECT_ANGULAR_BUILD: "fast" restart: unless-stopped env_file: - .env.pullpreview diff --git a/frontend/angular.json b/frontend/angular.json index 4be288938831..7c48128237c2 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -102,38 +102,6 @@ } ] }, - "fastprod": { - "index": "", - "preserveSymlinks": true, - "optimization": false, - "outputHashing": "all", - "sourceMap": false, - "namedChunks": false, - "extractLicenses": false, - "buildOptimizer" : false, - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" - } - ] - }, - "ci": { - "index": "", - "preserveSymlinks": true, - "optimization": false, - "outputHashing": "all", - "sourceMap": false, - "namedChunks": false, - "extractLicenses": false, - "buildOptimizer" : false, - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" - } - ] - } } }, "serve": { diff --git a/frontend/extra-webpack.config.js b/frontend/extra-webpack.config.js index 2eef5b817f14..4ca5c933c4b1 100644 --- a/frontend/extra-webpack.config.js +++ b/frontend/extra-webpack.config.js @@ -5,7 +5,7 @@ module.exports = { minimizer: [ new TerserPlugin({ terserOptions: { - mangle: process.env.OPENPROJECT_ANGULAR_UGLIFY !== 'false', + mangle: process.env.OPENPROJECT_ANGULAR_BUILD !== 'fast', keep_classnames: true, keep_fnames: true, } diff --git a/frontend/package.json b/frontend/package.json index 6ab4fc9227f5..5615a4afe820 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -162,8 +162,7 @@ }, "scripts": { "analyze": "ng build --configuration production --stats-json && webpack-bundle-analyzer -h 0.0.0.0 -p 9999 ../public/assets/frontend/stats.json", - "build:ci": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --configuration ci", - "build:fast": "OPENPROJECT_ANGULAR_UGLIFY=false node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --configuration fastprod", + "build:fast": "OPENPROJECT_ANGULAR_BUILD=fast node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --configuration production", "build": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --configuration production --named-chunks --source-map", "build:watch": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --watch --named-chunks", "tokens:generate": "theo src/app/spot/styles/tokens/tokens.yml --transform web --format sass,json --dest src/app/spot/styles/tokens/dist", diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index 63f497fc0e41..4e170ce29d90 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -63,9 +63,7 @@ namespace :assets do puts "Building angular frontend" Dir.chdir Rails.root.join("frontend") do cmd = - if ENV["CI"] - "npm run build:ci" - elsif ENV["OPENPROJECT_ANGULAR_UGLIFY"] == "false" + if ENV["OPENPROJECT_ANGULAR_BUILD"] == "fast" "npm run build:fast" else "npm run build"