|
| 1 | +{ |
| 2 | + "name": "bundle-size", |
| 3 | + "$schema": "../../node_modules/nx/schemas/project-schema.json", |
| 4 | + "sourceRoot": "apps/bundle-size/src", |
| 5 | + "projectType": "application", |
| 6 | + "tags": [], |
| 7 | + "targets": { |
| 8 | + "build": { |
| 9 | + "executor": "@nx/webpack:webpack", |
| 10 | + "outputs": ["{options.outputPath}"], |
| 11 | + "defaultConfiguration": "production", |
| 12 | + "options": { |
| 13 | + "compiler": "babel", |
| 14 | + "outputPath": "apps/bundle-size/dist", |
| 15 | + "index": "apps/bundle-size/src/index.html", |
| 16 | + "baseHref": "/", |
| 17 | + "main": "apps/bundle-size/src/index.ts", |
| 18 | + "tsConfig": "apps/bundle-size/tsconfig.app.json", |
| 19 | + "styles": [], |
| 20 | + "scripts": [], |
| 21 | + "webpackConfig": "apps/bundle-size/webpack.config.js", |
| 22 | + "babelUpwardRootMode": true |
| 23 | + }, |
| 24 | + "configurations": { |
| 25 | + "development": { |
| 26 | + "extractLicenses": false, |
| 27 | + "optimization": false, |
| 28 | + "sourceMap": true, |
| 29 | + "vendorChunk": true |
| 30 | + }, |
| 31 | + "production": { |
| 32 | + "optimization": true, |
| 33 | + "outputHashing": "all", |
| 34 | + "sourceMap": false, |
| 35 | + "namedChunks": false, |
| 36 | + "extractLicenses": false, |
| 37 | + "vendorChunk": false |
| 38 | + } |
| 39 | + }, |
| 40 | + "dependsOn": [ |
| 41 | + { |
| 42 | + "target": "build", |
| 43 | + "dependencies": true |
| 44 | + } |
| 45 | + ] |
| 46 | + }, |
| 47 | + "serve": { |
| 48 | + "executor": "@nx/webpack:dev-server", |
| 49 | + "defaultConfiguration": "production", |
| 50 | + "options": { |
| 51 | + "buildTarget": "bundle-size:build", |
| 52 | + "hmr": true, |
| 53 | + "port": 3005, |
| 54 | + "devRemotes": ["3006-runtime-remote"] |
| 55 | + }, |
| 56 | + "configurations": { |
| 57 | + "development": { |
| 58 | + "buildTarget": "bundle-size:build:development" |
| 59 | + }, |
| 60 | + "production": { |
| 61 | + "buildTarget": "bundle-size:build:production", |
| 62 | + "hmr": false |
| 63 | + } |
| 64 | + }, |
| 65 | + "dependsOn": [ |
| 66 | + { |
| 67 | + "target": "build", |
| 68 | + "dependencies": true |
| 69 | + } |
| 70 | + ] |
| 71 | + }, |
| 72 | + "lint": { |
| 73 | + "executor": "@nx/eslint:lint", |
| 74 | + "outputs": ["{options.outputFile}"], |
| 75 | + "options": { |
| 76 | + "lintFilePatterns": ["apps/bundle-size/**/*.{ts,tsx,js,jsx}"] |
| 77 | + } |
| 78 | + }, |
| 79 | + "serve-static": { |
| 80 | + "executor": "@nx/web:file-server", |
| 81 | + "defaultConfiguration": "development", |
| 82 | + "options": { |
| 83 | + "buildTarget": "bundle-size:build", |
| 84 | + "port": 3005 |
| 85 | + }, |
| 86 | + "configurations": { |
| 87 | + "development": { |
| 88 | + "buildTarget": "bundle-size:build:development" |
| 89 | + }, |
| 90 | + "production": { |
| 91 | + "buildTarget": "bundle-size:build:production" |
| 92 | + } |
| 93 | + } |
| 94 | + }, |
| 95 | + "e2e": { |
| 96 | + "executor": "@nx/cypress:cypress", |
| 97 | + "options": { |
| 98 | + "cypressConfig": "apps/bundle-size/cypress.config.ts", |
| 99 | + "testingType": "e2e", |
| 100 | + "baseUrl": "http://127.0.0.1:3005", |
| 101 | + "browser": "chrome" |
| 102 | + }, |
| 103 | + "dependsOn": [ |
| 104 | + { |
| 105 | + "target": "build", |
| 106 | + "dependencies": true |
| 107 | + } |
| 108 | + ], |
| 109 | + "configurations": { |
| 110 | + "development": { |
| 111 | + "runnerUi": true, |
| 112 | + "browser": "electron", |
| 113 | + "exit": false, |
| 114 | + "watch": true |
| 115 | + } |
| 116 | + } |
| 117 | + }, |
| 118 | + "test:e2e": { |
| 119 | + "executor": "nx:run-commands", |
| 120 | + "options": { |
| 121 | + "parallel": true, |
| 122 | + "commands": [ |
| 123 | + { |
| 124 | + "command": "lsof -i :3005 || nx run bundle-size:serve", |
| 125 | + "forwardAllArgs": false |
| 126 | + }, |
| 127 | + { |
| 128 | + "command": "sleep 4 && nx run bundle-size:e2e", |
| 129 | + "forwardAllArgs": true |
| 130 | + } |
| 131 | + ] |
| 132 | + } |
| 133 | + }, |
| 134 | + "getsize": { |
| 135 | + "executor": "nx:run-commands", |
| 136 | + "options": { |
| 137 | + "commands": [ |
| 138 | + { |
| 139 | + "command": "npx nx build bundle-size --configuration=production && sleep 1 && if [ -f apps/bundle-size/dist/remoteEntry.js ]; then ls -lah apps/bundle-size/dist/remoteEntry.js | awk '{print \"remoteEntry.js size: \" $5}' && gzip -c apps/bundle-size/dist/remoteEntry.js | wc -c | awk '{print \"gzip size: \" $1 \" bytes\"}' && brotli -c apps/bundle-size/dist/remoteEntry.js | wc -c | awk '{print \"brotli size: \" $1 \" bytes\"}'; else echo \"remoteEntry.js not found\"; fi" |
| 140 | + } |
| 141 | + ] |
| 142 | + } |
| 143 | + } |
| 144 | + } |
| 145 | +} |
0 commit comments