@nx/angular 17.0.2 → 17.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +9 -4
- package/esm2022/mf/mf.mjs +1 -1
- package/esm2022/src/runtime/nx/data-persistence.mjs +1 -1
- package/executors.d.ts +9 -2
- package/executors.js +7 -2
- package/executors.json +19 -9
- package/fesm2022/nx-angular-mf.mjs.map +1 -1
- package/fesm2022/nx-angular.mjs.map +1 -1
- package/generators.d.ts +1 -1
- package/generators.js +3 -1
- package/generators.json +7 -2
- package/migrations.json +451 -0
- package/ng-package.json +2 -2
- package/package.json +20 -26
- package/plugins/component-testing.d.ts +1 -26
- package/plugins/component-testing.js +15 -4
- package/src/builders/dev-server/dev-server.impl.d.ts +4 -0
- package/src/builders/dev-server/dev-server.impl.js +160 -0
- package/src/builders/{webpack-dev-server → dev-server}/lib/index.d.ts +1 -0
- package/src/builders/{webpack-dev-server → dev-server}/lib/index.js +1 -0
- package/src/builders/dev-server/lib/normalize-options.d.ts +2 -0
- package/src/builders/dev-server/lib/normalize-options.js +20 -0
- package/src/builders/dev-server/lib/validate-options.d.ts +2 -0
- package/src/builders/dev-server/lib/validate-options.js +22 -0
- package/src/builders/dev-server/schema.d.ts +39 -0
- package/src/builders/{webpack-dev-server → dev-server}/schema.json +42 -5
- package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.d.ts +1 -1
- package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.js +15 -9
- package/src/builders/utilities/module-federation.js +1 -1
- package/src/builders/webpack-browser/schema.d.ts +6 -2
- package/src/builders/webpack-browser/schema.json +15 -15
- package/src/builders/webpack-browser/webpack-browser.impl.js +8 -6
- package/src/builders/webpack-server/schema.d.ts +0 -1
- package/src/builders/webpack-server/schema.json +7 -20
- package/src/builders/webpack-server/validate-options.js +0 -7
- package/src/builders/webpack-server/webpack-server.impl.js +4 -9
- package/src/executors/application/application.impl.d.ts +3 -0
- package/src/executors/application/application.impl.js +37 -0
- package/src/executors/application/schema.d.ts +8 -0
- package/src/executors/application/schema.json +682 -0
- package/src/executors/application/utils/validate-options.d.ts +2 -0
- package/src/executors/application/utils/validate-options.js +52 -0
- package/src/executors/browser-esbuild/browser-esbuild.impl.d.ts +2 -3
- package/src/executors/browser-esbuild/browser-esbuild.impl.js +15 -8
- package/src/executors/browser-esbuild/schema.d.ts +3 -1
- package/src/executors/browser-esbuild/schema.json +38 -8
- package/src/executors/extract-i18n/extract-i18n.impl.d.ts +3 -0
- package/src/executors/extract-i18n/extract-i18n.impl.js +43 -0
- package/src/executors/extract-i18n/schema.d.ts +8 -0
- package/src/executors/extract-i18n/schema.json +45 -0
- package/src/executors/module-federation-dev-server/lib/build-static-remotes.d.ts +4 -0
- package/src/executors/module-federation-dev-server/lib/build-static-remotes.js +56 -0
- package/src/executors/module-federation-dev-server/lib/index.d.ts +5 -0
- package/src/executors/module-federation-dev-server/lib/index.js +8 -0
- package/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +2 -0
- package/src/executors/module-federation-dev-server/lib/normalize-options.js +23 -0
- package/src/executors/module-federation-dev-server/lib/parse-static-remotes-config.d.ts +11 -0
- package/src/executors/module-federation-dev-server/lib/parse-static-remotes-config.js +18 -0
- package/src/executors/module-federation-dev-server/lib/start-dev-remotes.d.ts +9 -0
- package/src/executors/module-federation-dev-server/lib/start-dev-remotes.js +29 -0
- package/src/executors/module-federation-dev-server/lib/start-static-remotes-file-server.d.ts +9 -0
- package/src/executors/module-federation-dev-server/lib/start-static-remotes-file-server.js +46 -0
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +4 -0
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +115 -0
- package/src/{builders → executors}/module-federation-dev-server/schema.d.ts +25 -7
- package/src/{builders → executors}/module-federation-dev-server/schema.json +31 -6
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.d.ts +3 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.js +34 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/entry-point/compile-ngc.transform.js +6 -4
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/entry-point/write-package.transform.js +25 -13
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ngc → pre-v17/ngc}/compile-source-files.d.ts +1 -2
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ngc → pre-v17/ngc}/compile-source-files.js +14 -9
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{styles → pre-v17/styles}/stylesheet-processor.d.ts +5 -10
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{styles → pre-v17/styles}/stylesheet-processor.js +39 -86
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.di.d.ts +2 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.di.js +12 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.transform.d.ts +8 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.transform.js +12 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.di.d.ts +8 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.di.js +18 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.transform.d.ts +8 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.transform.js +285 -0
- package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +5 -17
- package/src/executors/ng-packagr-lite/schema.json +1 -1
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +5 -3
- package/src/executors/package/ng-packagr-adjustments/ng-packagr.d.ts +3 -0
- package/src/executors/package/ng-packagr-adjustments/ng-packagr.js +28 -0
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.d.ts +1 -1
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +13 -6
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.d.ts +5 -10
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +39 -86
- package/src/executors/package/package.impl.d.ts +1 -1
- package/src/executors/package/package.impl.js +5 -15
- package/src/executors/package/schema.json +3 -3
- package/src/executors/utilities/buildable-libs.d.ts +6 -0
- package/src/executors/{browser-esbuild/lib → utilities}/buildable-libs.js +3 -4
- package/src/executors/utilities/esbuild-extensions.d.ts +10 -0
- package/src/executors/utilities/esbuild-extensions.js +50 -0
- package/src/executors/utilities/module-loader.d.ts +15 -0
- package/src/executors/utilities/module-loader.js +52 -0
- package/src/executors/utilities/ng-compiler-cli.d.ts +1 -0
- package/src/executors/utilities/ng-compiler-cli.js +8 -0
- package/src/executors/utilities/ng-packagr/stylesheet-processor.d.ts +49 -0
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.d.ts +2 -0
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +16 -0
- package/src/executors/utilities/ng-packagr/stylesheet-processor.js +209 -0
- package/src/executors/utilities/ng-packagr/tailwindcss.d.ts +7 -0
- package/src/executors/utilities/{tailwindcss.js → ng-packagr/tailwindcss.js} +5 -22
- package/src/executors/utilities/patch-builder-context.d.ts +3 -0
- package/src/executors/utilities/patch-builder-context.js +41 -0
- package/src/executors/utilities/typescript.js +1 -1
- package/src/generators/add-linting/add-linting.d.ts +1 -1
- package/src/generators/add-linting/add-linting.js +9 -15
- package/src/generators/add-linting/lib/add-angular-eslint-dependencies.d.ts +2 -2
- package/src/generators/add-linting/lib/add-angular-eslint-dependencies.js +9 -5
- package/src/generators/add-linting/lib/buildable-project.d.ts +2 -0
- package/src/generators/add-linting/lib/buildable-project.js +9 -0
- package/src/generators/add-linting/lib/create-eslint-configuration.d.ts +2 -2
- package/src/generators/add-linting/schema.json +1 -1
- package/src/generators/application/application.js +19 -17
- package/src/generators/application/files/base/tsconfig.app.json__tpl__ +1 -1
- package/src/generators/application/files/base/tsconfig.json__tpl__ +6 -2
- package/src/generators/application/files/ng-module/src/app/app.component.spec.ts__tpl__ +3 -1
- package/src/generators/application/files/ng-module/src/app/app.component.ts__tpl__ +4 -2
- package/src/generators/application/files/ng-module/src/app/app.module.ts__tpl__ +1 -1
- package/src/generators/application/files/ng-module/src/app/nx-welcome.component.ts__tpl__ +53 -14
- package/src/generators/application/files/ng-module/src/main.ts__tpl__ +2 -8
- package/src/generators/application/files/standalone-components/src/app/app.component.spec.ts__tpl__ +6 -4
- package/src/generators/application/files/standalone-components/src/app/app.component.ts__tpl__ +4 -2
- package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +3 -3
- package/src/generators/application/files/standalone-components/src/app/nx-welcome.component.ts__tpl__ +53 -14
- package/src/generators/application/files/standalone-components/src/main.ts__tpl__ +4 -8
- package/src/generators/application/lib/add-e2e.js +24 -8
- package/src/generators/application/lib/add-unit-test-runner.js +5 -20
- package/src/generators/application/lib/create-files.js +14 -10
- package/src/generators/application/lib/create-project.d.ts +1 -1
- package/src/generators/application/lib/create-project.js +48 -38
- package/src/generators/application/lib/index.d.ts +1 -0
- package/src/generators/application/lib/index.js +1 -0
- package/src/generators/application/lib/normalize-options.d.ts +1 -1
- package/src/generators/application/lib/normalize-options.js +28 -6
- package/src/generators/application/lib/normalized-schema.d.ts +5 -0
- package/src/generators/application/lib/set-generator-defaults.d.ts +3 -0
- package/src/generators/application/lib/set-generator-defaults.js +17 -0
- package/src/generators/application/lib/update-editor-tsconfig.d.ts +1 -1
- package/src/generators/application/lib/update-editor-tsconfig.js +11 -14
- package/src/generators/application/schema.d.ts +1 -0
- package/src/generators/application/schema.json +18 -10
- package/src/generators/component/component.js +4 -1
- package/src/generators/component/files/__fileName__.spec.ts__tpl__ +2 -3
- package/src/generators/component/files/__fileName__.ts__tpl__ +8 -2
- package/src/generators/component/lib/component.js +1 -1
- package/src/generators/component/lib/index.d.ts +1 -1
- package/src/generators/component/lib/index.js +1 -1
- package/src/generators/component/lib/normalize-options.js +3 -2
- package/src/generators/component/lib/set-generator-defaults.d.ts +3 -0
- package/src/generators/component/lib/set-generator-defaults.js +14 -0
- package/src/generators/component/schema.d.ts +3 -3
- package/src/generators/component/schema.json +4 -4
- package/src/generators/component-cypress-spec/files/__componentFileName__.__fileExt__ +13 -8
- package/src/generators/component-cypress-spec/schema.json +1 -1
- package/src/generators/component-story/files/__componentFileName__.stories.ts__tmpl__ +2 -2
- package/src/generators/component-test/component-test.d.ts +1 -1
- package/src/generators/component-test/component-test.js +8 -3
- package/src/generators/component-test/files/__componentFileName__.cy.ts__tpl__ +9 -11
- package/src/generators/component-test/schema.json +1 -1
- package/src/generators/convert-to-application-executor/convert-to-application-executor.d.ts +4 -0
- package/src/generators/convert-to-application-executor/convert-to-application-executor.js +242 -0
- package/src/generators/convert-to-application-executor/schema.d.ts +4 -0
- package/src/generators/convert-to-application-executor/schema.json +26 -0
- package/src/generators/convert-to-with-mf/convert-to-with-mf.js +3 -1
- package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +3 -2
- package/src/generators/convert-to-with-mf/schema.d.ts +1 -0
- package/src/generators/convert-to-with-mf/schema.json +6 -0
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +2 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +43 -24
- package/src/generators/directive/directive.js +0 -1
- package/src/generators/directive/files/__fileName__.ts__tpl__ +1 -3
- package/src/generators/directive/lib/index.d.ts +0 -1
- package/src/generators/directive/lib/index.js +0 -1
- package/src/generators/directive/lib/normalize-options.js +3 -1
- package/src/generators/directive/schema.d.ts +3 -3
- package/src/generators/directive/schema.json +4 -4
- package/src/generators/federate-module/federate-module.js +1 -0
- package/src/generators/federate-module/lib/add-remote.d.ts +1 -1
- package/src/generators/federate-module/lib/add-remote.js +2 -11
- package/src/generators/federate-module/schema.json +10 -10
- package/src/generators/host/files/common/v17+/src/main.server.ts__tmpl__ +67 -0
- package/src/generators/host/files/ts/webpack.server.config.ts__tmpl__ +2 -2
- package/src/generators/host/host.js +8 -9
- package/src/generators/host/lib/index.d.ts +1 -1
- package/src/generators/host/lib/index.js +1 -1
- package/src/generators/host/lib/update-ssr-setup.d.ts +3 -0
- package/src/generators/host/lib/{add-ssr.js → update-ssr-setup.js} +8 -14
- package/src/generators/host/schema.json +6 -6
- package/src/generators/init/init.d.ts +2 -2
- package/src/generators/init/init.js +19 -137
- package/src/generators/init/schema.d.ts +1 -9
- package/src/generators/init/schema.json +8 -59
- package/src/generators/library/files/ng-module/src/lib/lib.routes.ts__tpl__ +1 -1
- package/src/generators/library/files/standalone-components/src/lib/lib.routes.ts__tpl__ +1 -1
- package/src/generators/library/lib/add-load-children.js +2 -2
- package/src/generators/library/lib/add-project.js +24 -22
- package/src/generators/library/lib/add-standalone-component.d.ts +2 -2
- package/src/generators/library/lib/add-standalone-component.js +5 -4
- package/src/generators/library/lib/normalize-options.js +2 -5
- package/src/generators/library/lib/set-generator-defaults.d.ts +3 -0
- package/src/generators/library/lib/set-generator-defaults.js +15 -0
- package/src/generators/library/lib/update-tsconfig.js +3 -3
- package/src/generators/library/library.js +15 -27
- package/src/generators/library/schema.d.ts +1 -0
- package/src/generators/library/schema.json +13 -13
- package/src/generators/library-secondary-entry-point/files/src/index.ts__tmpl__ +1 -5
- package/src/generators/library-secondary-entry-point/lib/index.d.ts +0 -1
- package/src/generators/library-secondary-entry-point/lib/index.js +0 -1
- package/src/generators/library-secondary-entry-point/library-secondary-entry-point.js +3 -2
- package/src/generators/library-secondary-entry-point/schema.d.ts +1 -0
- package/src/generators/library-secondary-entry-point/schema.json +9 -3
- package/src/generators/move/schema.json +1 -1
- package/src/generators/ng-add/migrate-from-angular-cli.js +1 -1
- package/src/generators/ng-add/migrators/projects/app.migrator.js +50 -7
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +31 -23
- package/src/generators/ng-add/ng-add.js +1 -8
- package/src/generators/ng-add/schema.json +1 -1
- package/src/generators/ng-add/utilities/workspace.d.ts +1 -1
- package/src/generators/ng-add/utilities/workspace.js +9 -16
- package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.models.ts__tmpl__ +1 -1
- package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.selectors.spec.ts__tmpl__ +1 -1
- package/src/generators/ngrx/lib/generate-files.js +1 -10
- package/src/generators/ngrx/lib/validate-options.js +0 -23
- package/src/generators/ngrx/schema.json +3 -3
- package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.models.ts__tmpl__ +1 -1
- package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.selectors.spec.ts__tmpl__ +1 -1
- package/src/generators/ngrx-feature-store/lib/generate-files.js +1 -12
- package/src/generators/ngrx-feature-store/lib/validate-options.js +0 -22
- package/src/generators/ngrx-feature-store/schema.json +3 -3
- package/src/generators/ngrx-root-store/lib/normalize-options.js +1 -1
- package/src/generators/ngrx-root-store/lib/validate-options.js +0 -15
- package/src/generators/ngrx-root-store/schema.json +2 -2
- package/src/generators/pipe/files/__fileName__.ts__tpl__ +0 -2
- package/src/generators/pipe/lib/index.d.ts +0 -1
- package/src/generators/pipe/lib/index.js +0 -1
- package/src/generators/pipe/lib/normalize-options.js +1 -0
- package/src/generators/pipe/pipe.js +0 -1
- package/src/generators/pipe/schema.d.ts +3 -3
- package/src/generators/pipe/schema.json +4 -4
- package/src/generators/remote/files/base-ts/webpack.server.config.ts__tmpl__ +2 -2
- package/src/generators/remote/files/common/{src → pre-v17/src}/main.server.ts__tmpl__ +1 -3
- package/src/generators/remote/files/common/v17+/src/main.server.ts__tmpl__ +73 -0
- package/src/generators/remote/lib/index.d.ts +1 -1
- package/src/generators/remote/lib/index.js +1 -1
- package/src/generators/remote/lib/{add-ssr.d.ts → update-ssr-setup.d.ts} +1 -1
- package/src/generators/remote/lib/{add-ssr.js → update-ssr-setup.js} +9 -13
- package/src/generators/remote/remote.js +7 -9
- package/src/generators/remote/schema.json +6 -6
- package/src/generators/scam/lib/convert-component-to-scam.js +2 -1
- package/src/generators/scam/schema.d.ts +3 -3
- package/src/generators/scam/schema.json +2 -2
- package/src/generators/scam-directive/lib/convert-directive-to-scam.js +2 -1
- package/src/generators/scam-directive/scam-directive.js +3 -1
- package/src/generators/scam-directive/schema.d.ts +4 -3
- package/src/generators/scam-directive/schema.json +8 -2
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +2 -1
- package/src/generators/scam-pipe/scam-pipe.js +3 -1
- package/src/generators/scam-pipe/schema.d.ts +4 -3
- package/src/generators/scam-pipe/schema.json +8 -2
- package/src/generators/scam-to-standalone/scam-to-standalone.js +0 -7
- package/src/generators/scam-to-standalone/schema.json +2 -2
- package/src/generators/setup-mf/files/host-files/app.component.spec.ts__tmpl__ +3 -1
- package/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +12 -0
- package/src/generators/setup-mf/files/ts-webpack/tsconfig.lint.json__tmpl__ +12 -0
- package/src/generators/setup-mf/files/ts-webpack/webpack.config.ts__tmpl__ +1 -1
- package/src/generators/setup-mf/files/ts-webpack/webpack.prod.config.ts__tmpl__ +12 -12
- package/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +13 -1
- package/src/generators/setup-mf/lib/add-cypress-workaround.js +14 -4
- package/src/generators/setup-mf/lib/add-remote-entry.js +2 -11
- package/src/generators/setup-mf/lib/add-remote-to-host.js +1 -1
- package/src/generators/setup-mf/lib/fix-bootstrap.js +10 -18
- package/src/generators/setup-mf/lib/generate-config.js +3 -0
- package/src/generators/setup-mf/lib/index.d.ts +1 -1
- package/src/generators/setup-mf/lib/index.js +1 -1
- package/src/generators/setup-mf/lib/normalize-options.js +2 -1
- package/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +10 -10
- package/src/generators/setup-mf/lib/setup-serve-target.js +1 -1
- package/src/generators/setup-mf/lib/update-host-app-routes.js +2 -2
- package/src/generators/{pipe/lib/validate-options.d.ts → setup-mf/lib/update-tsconfig.d.ts} +1 -1
- package/src/generators/setup-mf/lib/update-tsconfig.js +19 -0
- package/src/generators/setup-mf/schema.d.ts +1 -0
- package/src/generators/setup-mf/schema.json +8 -3
- package/src/generators/setup-mf/setup-mf.js +1 -7
- package/src/generators/setup-ssr/files/ngmodule/base/src/__main__ +1 -1
- package/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ +56 -0
- package/src/generators/setup-ssr/files/{ngmodule/base → server/server-builder/pre-v17}/__serverFileName__ +7 -8
- package/src/generators/setup-ssr/files/{standalone → server/server-builder/v17+}/__serverFileName__ +25 -16
- package/src/generators/setup-ssr/lib/add-dependencies.d.ts +2 -0
- package/src/generators/setup-ssr/lib/add-dependencies.js +36 -0
- package/src/generators/setup-ssr/lib/add-hydration.js +11 -5
- package/src/generators/setup-ssr/lib/add-server-file.d.ts +3 -0
- package/src/generators/setup-ssr/lib/add-server-file.js +31 -0
- package/src/generators/setup-ssr/lib/constants.d.ts +3 -0
- package/src/generators/setup-ssr/lib/constants.js +6 -0
- package/src/generators/setup-ssr/lib/generate-files.d.ts +1 -1
- package/src/generators/setup-ssr/lib/generate-files.js +11 -16
- package/src/generators/setup-ssr/lib/generate-server-ts-config.d.ts +4 -0
- package/src/generators/setup-ssr/lib/generate-server-ts-config.js +29 -0
- package/src/generators/setup-ssr/lib/index.d.ts +4 -0
- package/src/generators/setup-ssr/lib/index.js +4 -0
- package/src/generators/setup-ssr/lib/normalize-options.js +7 -1
- package/src/generators/setup-ssr/lib/set-router-initial-navigation.d.ts +3 -0
- package/src/generators/setup-ssr/lib/set-router-initial-navigation.js +93 -0
- package/src/generators/setup-ssr/lib/update-project-config.d.ts +2 -1
- package/src/generators/setup-ssr/lib/update-project-config.js +46 -13
- package/src/generators/setup-ssr/lib/validate-options.js +15 -2
- package/src/generators/setup-ssr/schema.json +4 -4
- package/src/generators/setup-ssr/setup-ssr.js +18 -12
- package/src/generators/setup-tailwind/schema.json +1 -1
- package/src/generators/stories/schema.json +1 -1
- package/src/generators/stories/stories.js +2 -2
- package/src/generators/storybook-configuration/lib/generate-stories.js +6 -4
- package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +3 -1
- package/src/generators/storybook-configuration/schema.d.ts +1 -1
- package/src/generators/storybook-configuration/schema.json +7 -7
- package/src/generators/storybook-configuration/storybook-configuration.js +8 -5
- package/src/generators/utils/add-jest.d.ts +8 -0
- package/src/generators/utils/add-jest.js +36 -0
- package/src/generators/utils/add-mf-env-to-inputs.d.ts +2 -0
- package/src/generators/utils/add-mf-env-to-inputs.js +27 -0
- package/src/generators/utils/dependencies.js +1 -2
- package/src/generators/utils/ensure-angular-dependencies.d.ts +2 -0
- package/src/generators/utils/ensure-angular-dependencies.js +35 -0
- package/src/generators/utils/export-scam.js +2 -2
- package/src/generators/utils/project.d.ts +0 -1
- package/src/generators/utils/project.js +2 -29
- package/src/generators/utils/selector.d.ts +2 -2
- package/src/generators/utils/selector.js +11 -4
- package/src/generators/utils/testing.js +24 -1
- package/src/generators/utils/update-app-editor-tsconfig-excluded-files.d.ts +2 -0
- package/src/generators/utils/update-app-editor-tsconfig-excluded-files.js +23 -0
- package/src/generators/utils/update-project-root-tsconfig.d.ts +3 -0
- package/src/generators/utils/update-project-root-tsconfig.js +26 -0
- package/src/generators/utils/validations.d.ts +0 -1
- package/src/generators/utils/validations.js +1 -14
- package/src/generators/utils/version-utils.d.ts +2 -2
- package/src/generators/utils/version-utils.js +3 -3
- package/src/migrations/update-17-1-0/browser-target-to-build-target.d.ts +3 -0
- package/src/migrations/update-17-1-0/browser-target-to-build-target.js +50 -0
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.d.ts +2 -0
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.js +75 -0
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.d.ts +2 -0
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.js +183 -0
- package/src/migrations/update-17-1-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-17-1-0/update-angular-cli.js +23 -0
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.d.ts +2 -0
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.js +37 -0
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.d.ts +2 -0
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.js +40 -0
- package/src/migrations/update-17-3-0/add-autoprefixer-dependency.d.ts +2 -0
- package/src/migrations/update-17-3-0/add-autoprefixer-dependency.js +26 -0
- package/src/migrations/update-17-3-0/add-browser-sync-dependency.d.ts +2 -0
- package/src/migrations/update-17-3-0/add-browser-sync-dependency.js +26 -0
- package/src/migrations/update-17-3-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-17-3-0/update-angular-cli.js +23 -0
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.d.ts +2 -0
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.js +26 -0
- package/src/migrations/update-18-1-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-18-1-0/update-angular-cli.js +23 -0
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.d.ts +2 -0
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.js +53 -0
- package/src/migrations/update-18-2-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-18-2-0/update-angular-cli.js +23 -0
- package/src/utils/backward-compatible-versions.d.ts +6 -4
- package/src/utils/backward-compatible-versions.js +20 -22
- package/src/utils/{public-api.d.ts → index.d.ts} +5 -0
- package/src/utils/{public-api.js → index.js} +5 -0
- package/src/utils/mf/utils.js +7 -0
- package/src/utils/mf/with-module-federation-ssr.js +3 -0
- package/src/utils/mf/with-module-federation.js +3 -0
- package/src/utils/nx-devkit/ast-utils.js +4 -2
- package/src/utils/nx-devkit/testing.js +27 -31
- package/src/utils/targets.d.ts +2 -0
- package/src/utils/targets.js +17 -0
- package/src/utils/version-utils.d.ts +3 -3
- package/src/utils/versions.d.ts +9 -11
- package/src/utils/versions.js +10 -12
- package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -5
- package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js +0 -136
- package/src/builders/webpack-browser/validate-options.d.ts +0 -2
- package/src/builders/webpack-browser/validate-options.js +0 -40
- package/src/builders/webpack-dev-server/lib/normalize-options.d.ts +0 -2
- package/src/builders/webpack-dev-server/lib/normalize-options.js +0 -14
- package/src/builders/webpack-dev-server/schema.d.ts +0 -21
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.d.ts +0 -4
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.js +0 -105
- package/src/executors/browser-esbuild/lib/buildable-libs.d.ts +0 -9
- package/src/executors/browser-esbuild/lib/validate-options.d.ts +0 -2
- package/src/executors/browser-esbuild/lib/validate-options.js +0 -40
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ts/cache-compiler-host.d.ts +0 -16
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ts/cache-compiler-host.js +0 -175
- package/src/executors/package/ng-packagr-adjustments/ts/cache-compiler-host.d.ts +0 -15
- package/src/executors/package/ng-packagr-adjustments/ts/cache-compiler-host.js +0 -197
- package/src/executors/utilities/tailwindcss.d.ts +0 -7
- package/src/generators/application/files/tsconfig.editor.json__tpl__ +0 -5
- package/src/generators/application/files/v14/.browserlistrc__tpl__ +0 -16
- package/src/generators/application/files/v14/src/environments/environment.prod.ts__tpl__ +0 -3
- package/src/generators/application/files/v14/src/environments/environment.ts__tpl__ +0 -16
- package/src/generators/application/files/v14/src/polyfills.ts__tpl__ +0 -53
- package/src/generators/component/lib/validate-options.d.ts +0 -3
- package/src/generators/component/lib/validate-options.js +0 -8
- package/src/generators/directive/lib/validate-options.d.ts +0 -3
- package/src/generators/directive/lib/validate-options.js +0 -8
- package/src/generators/host/lib/add-ssr.d.ts +0 -3
- package/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.d.ts +0 -3
- package/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.js +0 -15
- package/src/generators/ngrx/files/no-inject/__directory__/__fileName__.effects.ts__tmpl__ +0 -22
- package/src/generators/ngrx/files/no-inject/__directory__/__fileName__.facade.ts__tmpl__ +0 -27
- package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.effects.ts__tmpl__ +0 -22
- package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.facade.ts__tmpl__ +0 -27
- package/src/generators/pipe/lib/validate-options.js +0 -8
- package/src/generators/setup-mf/lib/set-tsconfig-target.d.ts +0 -3
- package/src/generators/setup-mf/lib/set-tsconfig-target.js +0 -16
- package/src/generators/setup-ssr/files/ngmodule/v14/src/__main__ +0 -11
- package/src/generators/utils/create-ts-config.d.ts +0 -8
- package/src/generators/utils/create-ts-config.js +0 -35
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/entry-point/compile-ngc.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/entry-point/compile-ngc.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/entry-point/compile-ngc.transform.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/entry-point/entry-point.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/entry-point/entry-point.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/entry-point/entry-point.transform.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/entry-point/entry-point.transform.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/entry-point/write-package.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/entry-point/write-package.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/entry-point/write-package.transform.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/options.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/options.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/package.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{ng-package → pre-v17/ng-package}/package.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{styles → pre-v17/styles}/stylesheet-processor.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{styles → pre-v17/styles}/stylesheet-processor.di.js +0 -0
- /package/src/generators/host/files/common/{src → pre-v17/src}/main.server.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.actions.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.effects.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.effects.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.facade.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.facade.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.reducer.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.reducer.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.selectors.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.actions.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.effects.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.effects.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.facade.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.facade.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.reducer.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.reducer.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.selectors.ts__tmpl__ +0 -0
- /package/src/generators/setup-ssr/files/{base → root}/tsconfig.server.json__tpl__ +0 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeDevServerBuilder = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const js_1 = require("@nx/js");
|
|
6
|
+
const webpack_nx_build_coordination_plugin_1 = require("@nx/webpack/src/plugins/webpack-nx-build-coordination-plugin");
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const operators_1 = require("nx/src/project-graph/operators");
|
|
9
|
+
const project_graph_1 = require("nx/src/project-graph/project-graph");
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
const rxjs_1 = require("rxjs");
|
|
12
|
+
const operators_2 = require("rxjs/operators");
|
|
13
|
+
const angular_version_utils_1 = require("../../executors/utilities/angular-version-utils");
|
|
14
|
+
const esbuild_extensions_1 = require("../../executors/utilities/esbuild-extensions");
|
|
15
|
+
const patch_builder_context_1 = require("../../executors/utilities/patch-builder-context");
|
|
16
|
+
const buildable_libs_1 = require("../utilities/buildable-libs");
|
|
17
|
+
const webpack_1 = require("../utilities/webpack");
|
|
18
|
+
const lib_1 = require("./lib");
|
|
19
|
+
function executeDevServerBuilder(rawOptions, context) {
|
|
20
|
+
(0, lib_1.validateOptions)(rawOptions);
|
|
21
|
+
process.env.NX_TSCONFIG_PATH = (0, js_1.getRootTsConfigPath)();
|
|
22
|
+
const options = (0, lib_1.normalizeOptions)(rawOptions);
|
|
23
|
+
const parsedBuildTarget = (0, devkit_1.parseTargetString)(options.buildTarget, {
|
|
24
|
+
cwd: context.currentDirectory,
|
|
25
|
+
projectGraph: (0, devkit_1.readCachedProjectGraph)(),
|
|
26
|
+
projectName: context.target.project,
|
|
27
|
+
root: context.workspaceRoot,
|
|
28
|
+
isVerbose: false,
|
|
29
|
+
});
|
|
30
|
+
const browserTargetProjectConfiguration = (0, project_graph_1.readCachedProjectConfiguration)(parsedBuildTarget.project);
|
|
31
|
+
const buildTarget = browserTargetProjectConfiguration.targets[parsedBuildTarget.target];
|
|
32
|
+
const buildTargetOptions = {
|
|
33
|
+
...buildTarget.options,
|
|
34
|
+
...(parsedBuildTarget.configuration
|
|
35
|
+
? buildTarget.configurations[parsedBuildTarget.configuration]
|
|
36
|
+
: buildTarget.defaultConfiguration
|
|
37
|
+
? buildTarget.configurations[buildTarget.defaultConfiguration]
|
|
38
|
+
: {}),
|
|
39
|
+
};
|
|
40
|
+
const buildLibsFromSource = options.buildLibsFromSource ??
|
|
41
|
+
buildTargetOptions.buildLibsFromSource ??
|
|
42
|
+
true;
|
|
43
|
+
process.env.NX_BUILD_LIBS_FROM_SOURCE = `${buildLibsFromSource}`;
|
|
44
|
+
process.env.NX_BUILD_TARGET = options.buildTarget;
|
|
45
|
+
let pathToWebpackConfig;
|
|
46
|
+
if (buildTargetOptions.customWebpackConfig?.path) {
|
|
47
|
+
pathToWebpackConfig = (0, devkit_1.joinPathFragments)(context.workspaceRoot, buildTargetOptions.customWebpackConfig.path);
|
|
48
|
+
if (pathToWebpackConfig && !(0, fs_1.existsSync)(pathToWebpackConfig)) {
|
|
49
|
+
throw new Error(`Custom Webpack Config File Not Found!\nTo use a custom webpack config, please ensure the path to the custom webpack file is correct: \n${pathToWebpackConfig}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const normalizedIndexHtmlTransformer = buildTargetOptions.indexHtmlTransformer ??
|
|
53
|
+
buildTargetOptions.indexFileTransformer;
|
|
54
|
+
let pathToIndexFileTransformer;
|
|
55
|
+
if (normalizedIndexHtmlTransformer) {
|
|
56
|
+
pathToIndexFileTransformer = (0, devkit_1.joinPathFragments)(context.workspaceRoot, normalizedIndexHtmlTransformer);
|
|
57
|
+
if (pathToIndexFileTransformer && !(0, fs_1.existsSync)(pathToIndexFileTransformer)) {
|
|
58
|
+
throw new Error(`File containing Index File Transformer function Not Found!\n Please ensure the path to the file containing the function is correct: \n${pathToIndexFileTransformer}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
let dependencies;
|
|
62
|
+
if (!buildLibsFromSource) {
|
|
63
|
+
const { tsConfigPath, dependencies: foundDependencies } = (0, buildable_libs_1.createTmpTsConfigForBuildableLibs)(buildTargetOptions.tsConfig, context, {
|
|
64
|
+
target: parsedBuildTarget.target,
|
|
65
|
+
});
|
|
66
|
+
dependencies = foundDependencies;
|
|
67
|
+
const relativeTsConfigPath = (0, devkit_1.normalizePath)((0, path_1.relative)(context.workspaceRoot, tsConfigPath));
|
|
68
|
+
// We can't just pass the tsconfig path in memory to the angular builder
|
|
69
|
+
// function because we can't pass the build target options to it, the build
|
|
70
|
+
// targets options will be retrieved by the builder from the project
|
|
71
|
+
// configuration. Therefore, we patch the method in the context to retrieve
|
|
72
|
+
// the target options to overwrite the tsconfig path to use the generated
|
|
73
|
+
// one with the updated path mappings.
|
|
74
|
+
const originalGetTargetOptions = context.getTargetOptions;
|
|
75
|
+
context.getTargetOptions = async (target) => {
|
|
76
|
+
const options = await originalGetTargetOptions(target);
|
|
77
|
+
options.tsConfig = relativeTsConfigPath;
|
|
78
|
+
return options;
|
|
79
|
+
};
|
|
80
|
+
// The buildTargetConfiguration also needs to use the generated tsconfig path
|
|
81
|
+
// otherwise the build will fail if customWebpack function/file is referencing
|
|
82
|
+
// local libs. This synchronize the behavior with webpack-browser and
|
|
83
|
+
// webpack-server implementation.
|
|
84
|
+
buildTargetOptions.tsConfig = relativeTsConfigPath;
|
|
85
|
+
}
|
|
86
|
+
const delegateBuilderOptions = getDelegateBuilderOptions(options);
|
|
87
|
+
const isUsingWebpackBuilder = ![
|
|
88
|
+
'@angular-devkit/build-angular:application',
|
|
89
|
+
'@angular-devkit/build-angular:browser-esbuild',
|
|
90
|
+
'@nx/angular:application',
|
|
91
|
+
'@nx/angular:browser-esbuild',
|
|
92
|
+
].includes(buildTarget.executor);
|
|
93
|
+
/**
|
|
94
|
+
* The Angular CLI dev-server builder make some decisions based on the build
|
|
95
|
+
* target builder but it only considers `@angular-devkit/build-angular:*`
|
|
96
|
+
* builders. Since we are using a custom builder, we patch the context to
|
|
97
|
+
* handle `@nx/angular:*` executors.
|
|
98
|
+
*/
|
|
99
|
+
(0, patch_builder_context_1.patchBuilderContext)(context, !isUsingWebpackBuilder, parsedBuildTarget);
|
|
100
|
+
return (0, rxjs_1.combineLatest)([
|
|
101
|
+
(0, rxjs_1.from)(Promise.resolve().then(() => require('@angular-devkit/build-angular'))),
|
|
102
|
+
(0, rxjs_1.from)((0, esbuild_extensions_1.loadPlugins)(buildTargetOptions.plugins, buildTargetOptions.tsConfig)),
|
|
103
|
+
(0, rxjs_1.from)((0, esbuild_extensions_1.loadMiddleware)(options.esbuildMiddleware, buildTargetOptions.tsConfig)),
|
|
104
|
+
(0, rxjs_1.from)(loadIndexHtmlFileTransformer(pathToIndexFileTransformer, buildTargetOptions.tsConfig, context, isUsingWebpackBuilder)),
|
|
105
|
+
]).pipe((0, operators_2.switchMap)(([{ executeDevServerBuilder }, plugins, middleware, indexHtmlTransformer,]) => executeDevServerBuilder(delegateBuilderOptions, context, {
|
|
106
|
+
webpackConfiguration: isUsingWebpackBuilder
|
|
107
|
+
? async (baseWebpackConfig) => {
|
|
108
|
+
if (!buildLibsFromSource) {
|
|
109
|
+
const workspaceDependencies = dependencies
|
|
110
|
+
.filter((dep) => !(0, operators_1.isNpmProject)(dep.node))
|
|
111
|
+
.map((dep) => dep.node.name);
|
|
112
|
+
// default for `nx run-many` is --all projects
|
|
113
|
+
// by passing an empty string for --projects, run-many will default to
|
|
114
|
+
// run the target for all projects.
|
|
115
|
+
// This will occur when workspaceDependencies = []
|
|
116
|
+
if (workspaceDependencies.length > 0) {
|
|
117
|
+
baseWebpackConfig.plugins.push(
|
|
118
|
+
// @ts-expect-error - difference between angular and webpack plugin definitions bc of webpack versions
|
|
119
|
+
new webpack_nx_build_coordination_plugin_1.WebpackNxBuildCoordinationPlugin(`nx run-many --target=${parsedBuildTarget.target} --projects=${workspaceDependencies.join(',')}`));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (!pathToWebpackConfig) {
|
|
123
|
+
return baseWebpackConfig;
|
|
124
|
+
}
|
|
125
|
+
return (0, webpack_1.mergeCustomWebpackConfig)(baseWebpackConfig, pathToWebpackConfig, buildTargetOptions, context.target);
|
|
126
|
+
}
|
|
127
|
+
: undefined,
|
|
128
|
+
...(indexHtmlTransformer
|
|
129
|
+
? {
|
|
130
|
+
indexHtml: indexHtmlTransformer,
|
|
131
|
+
}
|
|
132
|
+
: {}),
|
|
133
|
+
}, {
|
|
134
|
+
buildPlugins: plugins,
|
|
135
|
+
middleware,
|
|
136
|
+
})));
|
|
137
|
+
}
|
|
138
|
+
exports.executeDevServerBuilder = executeDevServerBuilder;
|
|
139
|
+
exports.default = require('@angular-devkit/architect').createBuilder(executeDevServerBuilder);
|
|
140
|
+
function getDelegateBuilderOptions(options) {
|
|
141
|
+
const delegateBuilderOptions = {
|
|
142
|
+
...options,
|
|
143
|
+
};
|
|
144
|
+
const { major: angularMajorVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
145
|
+
if (angularMajorVersion <= 17) {
|
|
146
|
+
delegateBuilderOptions.browserTarget = delegateBuilderOptions.buildTarget;
|
|
147
|
+
delete delegateBuilderOptions.buildTarget;
|
|
148
|
+
}
|
|
149
|
+
// delete extra option not supported by the delegate builder
|
|
150
|
+
delete delegateBuilderOptions.buildLibsFromSource;
|
|
151
|
+
return delegateBuilderOptions;
|
|
152
|
+
}
|
|
153
|
+
async function loadIndexHtmlFileTransformer(pathToIndexFileTransformer, tsConfig, context, isUsingWebpackBuilder) {
|
|
154
|
+
if (!pathToIndexFileTransformer) {
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
return isUsingWebpackBuilder
|
|
158
|
+
? (0, webpack_1.resolveIndexHtmlTransformer)(pathToIndexFileTransformer, tsConfig, context.target)
|
|
159
|
+
: await (0, esbuild_extensions_1.loadIndexHtmlTransformer)(pathToIndexFileTransformer, tsConfig);
|
|
160
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeOptions = void 0;
|
|
4
|
+
function normalizeOptions(schema) {
|
|
5
|
+
let buildTarget = schema.buildTarget;
|
|
6
|
+
if (schema.browserTarget) {
|
|
7
|
+
buildTarget ??= schema.browserTarget;
|
|
8
|
+
delete schema.browserTarget;
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
...schema,
|
|
12
|
+
buildTarget,
|
|
13
|
+
host: schema.host ?? 'localhost',
|
|
14
|
+
port: schema.port ?? 4200,
|
|
15
|
+
liveReload: schema.liveReload ?? true,
|
|
16
|
+
open: schema.open ?? false,
|
|
17
|
+
ssl: schema.ssl ?? false,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
exports.normalizeOptions = normalizeOptions;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateOptions = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const semver_1 = require("semver");
|
|
6
|
+
const angular_version_utils_1 = require("../../../executors/utilities/angular-version-utils");
|
|
7
|
+
function validateOptions(options) {
|
|
8
|
+
const { major: angularMajorVersion, version: angularVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
9
|
+
if ((0, semver_1.lt)(angularVersion, '16.1.0') && options.forceEsbuild) {
|
|
10
|
+
throw new Error((0, devkit_1.stripIndents) `The "forceEsbuild" option is only supported in Angular >= 16.1.0. You are currently using "${angularVersion}".
|
|
11
|
+
You can resolve this error by removing the "forceEsbuild" option or by migrating to Angular 16.1.0.`);
|
|
12
|
+
}
|
|
13
|
+
if (angularMajorVersion < 17 && options.esbuildMiddleware?.length > 0) {
|
|
14
|
+
throw new Error((0, devkit_1.stripIndents) `The "esbuildMiddleware" option is only supported in Angular >= 17.0.0. You are currently using "${angularVersion}".
|
|
15
|
+
You can resolve this error by removing the "esbuildMiddleware" option or by migrating to Angular 17.0.0.`);
|
|
16
|
+
}
|
|
17
|
+
if ((0, semver_1.lt)(angularVersion, '17.2.0') && options.prebundle) {
|
|
18
|
+
throw new Error((0, devkit_1.stripIndents) `The "prebundle" option is only supported in Angular >= 17.2.0. You are currently using "${angularVersion}".
|
|
19
|
+
You can resolve this error by removing the "prebundle" option or by migrating to Angular 17.2.0.`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.validateOptions = validateOptions;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
interface BaseSchema {
|
|
2
|
+
port?: number;
|
|
3
|
+
host?: string;
|
|
4
|
+
proxyConfig?: string;
|
|
5
|
+
ssl?: boolean;
|
|
6
|
+
sslKey?: string;
|
|
7
|
+
sslCert?: string;
|
|
8
|
+
headers?: Record<string, string>;
|
|
9
|
+
open?: boolean;
|
|
10
|
+
verbose?: boolean;
|
|
11
|
+
liveReload?: boolean;
|
|
12
|
+
publicHost?: string;
|
|
13
|
+
allowedHosts?: string[];
|
|
14
|
+
servePath?: string;
|
|
15
|
+
disableHostCheck?: boolean;
|
|
16
|
+
hmr?: boolean;
|
|
17
|
+
watch?: boolean;
|
|
18
|
+
poll?: number;
|
|
19
|
+
forceEsbuild?: boolean;
|
|
20
|
+
prebundle?: boolean | { exclude: string[] };
|
|
21
|
+
buildLibsFromSource?: boolean;
|
|
22
|
+
esbuildMiddleware?: string[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type SchemaWithBrowserTarget = BaseSchema & {
|
|
26
|
+
browserTarget: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type SchemaWithBuildTarget = BaseSchema & {
|
|
30
|
+
buildTarget: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type Schema = SchemaWithBrowserTarget | SchemaWithBuildTarget;
|
|
34
|
+
|
|
35
|
+
export type NormalizedSchema = SchemaWithBuildTarget & {
|
|
36
|
+
liveReload: boolean;
|
|
37
|
+
open: boolean;
|
|
38
|
+
ssl: boolean;
|
|
39
|
+
};
|
|
@@ -3,19 +3,25 @@
|
|
|
3
3
|
"outputCapture": "direct-nodejs",
|
|
4
4
|
"$schema": "http://json-schema.org/draft-07/schema",
|
|
5
5
|
"title": "Schema for Webpack Dev Server",
|
|
6
|
-
"description": "
|
|
7
|
-
"examplesFile": "../../../docs/
|
|
6
|
+
"description": "Serves an Angular application using [Webpack](https://webpack.js.org/) when the build target is using a Webpack-based executor, or [Vite](https://vitejs.dev/) when the build target uses an esbuild-based executor.",
|
|
7
|
+
"examplesFile": "../../../docs/dev-server-examples.md",
|
|
8
8
|
"type": "object",
|
|
9
9
|
"presets": [
|
|
10
10
|
{
|
|
11
11
|
"name": "Using a Different Port",
|
|
12
|
-
"keys": ["
|
|
12
|
+
"keys": ["buildTarget", "port"]
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"properties": {
|
|
16
16
|
"browserTarget": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "A browser builder target to serve in the format of `project:target[:configuration]`.
|
|
18
|
+
"description": "A browser builder target to serve in the format of `project:target[:configuration]`. Ignored if `buildTarget` is set.",
|
|
19
|
+
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$",
|
|
20
|
+
"x-deprecated": "Use 'buildTarget' instead. It will be removed in Nx v19."
|
|
21
|
+
},
|
|
22
|
+
"buildTarget": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "A build builder target to serve in the format of `project:target[:configuration]`.",
|
|
19
25
|
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
|
|
20
26
|
},
|
|
21
27
|
"port": {
|
|
@@ -105,12 +111,43 @@
|
|
|
105
111
|
"type": "number",
|
|
106
112
|
"description": "Enable and define the file watching poll time period in milliseconds."
|
|
107
113
|
},
|
|
114
|
+
"forceEsbuild": {
|
|
115
|
+
"type": "boolean",
|
|
116
|
+
"description": "Force the development server to use the 'browser-esbuild' builder when building. This is a developer preview option for the esbuild-based build system. _Note: this is only supported in Angular versions >= 16.1.0_.",
|
|
117
|
+
"default": false
|
|
118
|
+
},
|
|
119
|
+
"prebundle": {
|
|
120
|
+
"description": "Enable and control the Vite-based development server's prebundling capabilities. To enable prebundling, the Angular CLI cache must also be enabled. This option has no effect when using the 'browser' or other Webpack-based builders. _Note: this is only supported in Angular versions >= 17.2.0_.",
|
|
121
|
+
"oneOf": [
|
|
122
|
+
{ "type": "boolean" },
|
|
123
|
+
{
|
|
124
|
+
"type": "object",
|
|
125
|
+
"properties": {
|
|
126
|
+
"exclude": {
|
|
127
|
+
"description": "List of package imports that should not be prebundled by the development server. The packages will be bundled into the application code itself.",
|
|
128
|
+
"type": "array",
|
|
129
|
+
"items": { "type": "string" }
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"additionalProperties": false,
|
|
133
|
+
"required": ["exclude"]
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
},
|
|
108
137
|
"buildLibsFromSource": {
|
|
109
138
|
"type": "boolean",
|
|
110
139
|
"description": "Read buildable libraries from source instead of building them separately. If not set, it will take the value specified in the `browserTarget` options, or it will default to `true` if it's also not set in the `browserTarget` options.",
|
|
111
140
|
"x-priority": "important"
|
|
141
|
+
},
|
|
142
|
+
"esbuildMiddleware": {
|
|
143
|
+
"description": "A list of HTTP request middleware functions. _Note: this is only supported in Angular versions >= 17.0.0_.",
|
|
144
|
+
"type": "array",
|
|
145
|
+
"items": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"description": "The path to the middleware function. Relative to the workspace root."
|
|
148
|
+
}
|
|
112
149
|
}
|
|
113
150
|
},
|
|
114
151
|
"additionalProperties": false,
|
|
115
|
-
"required": ["browserTarget"]
|
|
152
|
+
"anyOf": [{ "required": ["buildTarget"] }, { "required": ["browserTarget"] }]
|
|
116
153
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Schema } from './schema';
|
|
2
|
-
export declare function executeModuleFederationDevSSRBuilder(schema: Schema, context: import('@angular-devkit/architect').BuilderContext): import("rxjs").Observable<
|
|
2
|
+
export declare function executeModuleFederationDevSSRBuilder(schema: Schema, context: import('@angular-devkit/architect').BuilderContext): import("rxjs").Observable<unknown>;
|
|
3
3
|
declare const _default: any;
|
|
4
4
|
export default _default;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeModuleFederationDevSSRBuilder = void 0;
|
|
4
|
-
const project_graph_1 = require("nx/src/project-graph/project-graph");
|
|
5
|
-
const executor_utils_1 = require("nx/src/command-line/run/executor-utils");
|
|
6
4
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const module_federation_1 = require("../utilities/module-federation");
|
|
8
|
-
const operators_1 = require("rxjs/operators");
|
|
9
|
-
const rxjs_1 = require("rxjs");
|
|
10
|
-
const path_1 = require("path");
|
|
11
5
|
const child_process_1 = require("child_process");
|
|
12
|
-
const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
|
|
13
6
|
const fs_1 = require("fs");
|
|
7
|
+
const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
|
|
8
|
+
const executor_utils_1 = require("nx/src/command-line/run/executor-utils");
|
|
9
|
+
const project_graph_1 = require("nx/src/project-graph/project-graph");
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
const rxjs_1 = require("rxjs");
|
|
12
|
+
const operators_1 = require("rxjs/operators");
|
|
13
|
+
const angular_version_utils_1 = require("../../executors/utilities/angular-version-utils");
|
|
14
|
+
const module_federation_1 = require("../utilities/module-federation");
|
|
14
15
|
function executeModuleFederationDevSSRBuilder(schema, context) {
|
|
15
16
|
const { ...options } = schema;
|
|
16
17
|
const projectGraph = (0, devkit_1.readCachedProjectGraph)();
|
|
@@ -50,7 +51,7 @@ function executeModuleFederationDevSSRBuilder(schema, context) {
|
|
|
50
51
|
const runOptions = {};
|
|
51
52
|
if (options.verbose) {
|
|
52
53
|
const [collection, executor] = workspaceProjects[remote].targets[target].executor.split(':');
|
|
53
|
-
const { schema } = (0, executor_utils_1.getExecutorInformation)(collection, executor, devkit_1.workspaceRoot);
|
|
54
|
+
const { schema } = (0, executor_utils_1.getExecutorInformation)(collection, executor, devkit_1.workspaceRoot, workspaceProjects);
|
|
54
55
|
if (schema.additionalProperties || 'verbose' in schema.properties) {
|
|
55
56
|
runOptions.verbose = options.verbose;
|
|
56
57
|
}
|
|
@@ -78,6 +79,7 @@ function executeModuleFederationDevSSRBuilder(schema, context) {
|
|
|
78
79
|
target,
|
|
79
80
|
configuration: context.target.configuration,
|
|
80
81
|
runOptions,
|
|
82
|
+
projects: workspaceProjects,
|
|
81
83
|
}, options.verbose).then((obs) => obs
|
|
82
84
|
.pipe((0, operators_1.tap)((result) => {
|
|
83
85
|
result.success && res();
|
|
@@ -87,7 +89,11 @@ function executeModuleFederationDevSSRBuilder(schema, context) {
|
|
|
87
89
|
});
|
|
88
90
|
remoteProcessPromises.push(remotePromise);
|
|
89
91
|
}
|
|
90
|
-
|
|
92
|
+
const { major: angularMajorVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
93
|
+
const { executeSSRDevServerBuilder } = angularMajorVersion >= 17
|
|
94
|
+
? require('@angular-devkit/build-angular')
|
|
95
|
+
: require('@nguniversal/builders');
|
|
96
|
+
return (0, rxjs_1.from)(Promise.all(remoteProcessPromises)).pipe((0, operators_1.switchMap)(() => executeSSRDevServerBuilder(options, context)));
|
|
91
97
|
}
|
|
92
98
|
exports.executeModuleFederationDevSSRBuilder = executeModuleFederationDevSSRBuilder;
|
|
93
99
|
exports.default = require('@angular-devkit/architect').createBuilder(executeModuleFederationDevSSRBuilder);
|
|
@@ -85,7 +85,7 @@ function getStaticRemotes(project, context, workspaceProjects, remotesToSkip) {
|
|
|
85
85
|
}
|
|
86
86
|
exports.getStaticRemotes = getStaticRemotes;
|
|
87
87
|
function validateDevRemotes(options, workspaceProjects) {
|
|
88
|
-
const invalidDevRemotes = options.devRemotes?.filter((remote) => !workspaceProjects[remote]);
|
|
88
|
+
const invalidDevRemotes = options.devRemotes?.filter((remote) => !workspaceProjects[remote]) ?? [];
|
|
89
89
|
if (invalidDevRemotes.length) {
|
|
90
90
|
throw new Error(invalidDevRemotes.length === 1
|
|
91
91
|
? `Invalid dev remote provided: ${invalidDevRemotes[0]}.`
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { Schema } from '@angular-devkit/build-angular/src/builders/browser/schema';
|
|
1
|
+
import type { Schema } from '@angular-devkit/build-angular/src/builders/browser/schema';
|
|
2
2
|
|
|
3
3
|
export type BrowserBuilderSchema = Schema & {
|
|
4
4
|
customWebpackConfig?: {
|
|
5
5
|
path: string;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
indexHtmlTransformer?: string;
|
|
8
8
|
buildLibsFromSource?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `indexHtmlTransformer` instead. It will be removed in Nx 19.
|
|
11
|
+
*/
|
|
12
|
+
indexFileTransformer?: string;
|
|
9
13
|
};
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"oneOf": [
|
|
42
42
|
{
|
|
43
43
|
"type": "array",
|
|
44
|
-
"description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.
|
|
44
|
+
"description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
|
|
45
45
|
"items": {
|
|
46
46
|
"type": "string",
|
|
47
47
|
"uniqueItems": true
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"input": {
|
|
107
107
|
"type": "string",
|
|
108
108
|
"description": "The file to include.",
|
|
109
|
-
"pattern": "\\.(?:css|scss|sass|less
|
|
109
|
+
"pattern": "\\.(?:css|scss|sass|less)$"
|
|
110
110
|
},
|
|
111
111
|
"bundleName": {
|
|
112
112
|
"type": "string",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
{
|
|
126
126
|
"type": "string",
|
|
127
127
|
"description": "The file to include.",
|
|
128
|
-
"pattern": "\\.(?:css|scss|sass|less
|
|
128
|
+
"pattern": "\\.(?:css|scss|sass|less)$"
|
|
129
129
|
}
|
|
130
130
|
]
|
|
131
131
|
},
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
},
|
|
229
229
|
"outputPath": {
|
|
230
230
|
"type": "string",
|
|
231
|
-
"description": "The full path for the new output directory, relative to the current workspace
|
|
231
|
+
"description": "The full path for the new output directory, relative to the current workspace."
|
|
232
232
|
},
|
|
233
233
|
"resourcesOutputPath": {
|
|
234
234
|
"type": "string",
|
|
@@ -278,12 +278,12 @@
|
|
|
278
278
|
},
|
|
279
279
|
"vendorChunk": {
|
|
280
280
|
"type": "boolean",
|
|
281
|
-
"description": "Generate a
|
|
281
|
+
"description": "Generate a separate bundle containing only vendor libraries. This option should only be used for development to reduce the incremental compilation time.",
|
|
282
282
|
"default": false
|
|
283
283
|
},
|
|
284
284
|
"commonChunk": {
|
|
285
285
|
"type": "boolean",
|
|
286
|
-
"description": "Generate a
|
|
286
|
+
"description": "Generate a separate bundle containing code used across multiple bundles.",
|
|
287
287
|
"default": true
|
|
288
288
|
},
|
|
289
289
|
"baseHref": {
|
|
@@ -292,8 +292,7 @@
|
|
|
292
292
|
},
|
|
293
293
|
"deployUrl": {
|
|
294
294
|
"type": "string",
|
|
295
|
-
"description": "
|
|
296
|
-
"x-deprecated": "Use `baseHref` option, `APP_BASE_HREF` DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url."
|
|
295
|
+
"description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations."
|
|
297
296
|
},
|
|
298
297
|
"verbose": {
|
|
299
298
|
"type": "boolean",
|
|
@@ -439,7 +438,7 @@
|
|
|
439
438
|
"enum": ["none", "anonymous", "use-credentials"]
|
|
440
439
|
},
|
|
441
440
|
"allowedCommonJsDependencies": {
|
|
442
|
-
"description": "A list of CommonJS packages that are allowed to be used without a build time warning.",
|
|
441
|
+
"description": "A list of CommonJS or AMD packages that are allowed to be used without a build time warning. Use `'*'` to allow all.",
|
|
443
442
|
"type": "array",
|
|
444
443
|
"items": {
|
|
445
444
|
"type": "string"
|
|
@@ -458,9 +457,10 @@
|
|
|
458
457
|
"x-priority": "important",
|
|
459
458
|
"additionalProperties": false
|
|
460
459
|
},
|
|
461
|
-
"
|
|
460
|
+
"indexHtmlTransformer": {
|
|
462
461
|
"description": "Path to transformer function to transform the index.html",
|
|
463
|
-
"type": "string"
|
|
462
|
+
"type": "string",
|
|
463
|
+
"alias": "indexFileTransformer"
|
|
464
464
|
},
|
|
465
465
|
"buildLibsFromSource": {
|
|
466
466
|
"type": "boolean",
|
|
@@ -516,11 +516,11 @@
|
|
|
516
516
|
"properties": {
|
|
517
517
|
"src": {
|
|
518
518
|
"type": "string",
|
|
519
|
-
"pattern": "\\.(([cm]?
|
|
519
|
+
"pattern": "\\.(([cm]?[jt])sx?|json)$"
|
|
520
520
|
},
|
|
521
521
|
"replaceWith": {
|
|
522
522
|
"type": "string",
|
|
523
|
-
"pattern": "\\.(([cm]?
|
|
523
|
+
"pattern": "\\.(([cm]?[jt])sx?|json)$"
|
|
524
524
|
}
|
|
525
525
|
},
|
|
526
526
|
"additionalProperties": false,
|
|
@@ -531,11 +531,11 @@
|
|
|
531
531
|
"properties": {
|
|
532
532
|
"replace": {
|
|
533
533
|
"type": "string",
|
|
534
|
-
"pattern": "\\.(([cm]?
|
|
534
|
+
"pattern": "\\.(([cm]?[jt])sx?|json)$"
|
|
535
535
|
},
|
|
536
536
|
"with": {
|
|
537
537
|
"type": "string",
|
|
538
|
-
"pattern": "\\.(([cm]?
|
|
538
|
+
"pattern": "\\.(([cm]?[jt])sx?|json)$"
|
|
539
539
|
}
|
|
540
540
|
},
|
|
541
541
|
"additionalProperties": false,
|
|
@@ -7,11 +7,11 @@ const fs_1 = require("fs");
|
|
|
7
7
|
const configuration_1 = require("nx/src/config/configuration");
|
|
8
8
|
const operators_1 = require("nx/src/project-graph/operators");
|
|
9
9
|
const utils_1 = require("nx/src/tasks-runner/utils");
|
|
10
|
+
const path_1 = require("path");
|
|
10
11
|
const rxjs_1 = require("rxjs");
|
|
11
12
|
const operators_2 = require("rxjs/operators");
|
|
12
13
|
const buildable_libs_1 = require("../utilities/buildable-libs");
|
|
13
14
|
const webpack_1 = require("../utilities/webpack");
|
|
14
|
-
const validate_options_1 = require("./validate-options");
|
|
15
15
|
function shouldSkipInitialTargetRun(projectGraph, project, target) {
|
|
16
16
|
const nxJson = (0, configuration_1.readNxJson)();
|
|
17
17
|
const defaultDependencyConfigs = Object.entries(nxJson.targetDefaults ?? {}).reduce((acc, [targetName, dependencyConfig]) => {
|
|
@@ -23,16 +23,18 @@ function shouldSkipInitialTargetRun(projectGraph, project, target) {
|
|
|
23
23
|
return projectDependencyConfigs.some((d) => d.target === target && d.projects === 'dependencies');
|
|
24
24
|
}
|
|
25
25
|
function executeWebpackBrowserBuilder(options, context) {
|
|
26
|
-
(0, validate_options_1.validateOptions)(options);
|
|
27
26
|
options.buildLibsFromSource ??= true;
|
|
28
|
-
const { buildLibsFromSource, customWebpackConfig, indexFileTransformer, ...delegateBuilderOptions } = options;
|
|
27
|
+
const { buildLibsFromSource, customWebpackConfig, indexHtmlTransformer, indexFileTransformer, ...delegateBuilderOptions } = options;
|
|
28
|
+
process.env.NX_BUILD_LIBS_FROM_SOURCE = `${buildLibsFromSource}`;
|
|
29
|
+
process.env.NX_BUILD_TARGET = (0, devkit_1.targetToTargetString)({ ...context.target });
|
|
29
30
|
const pathToWebpackConfig = customWebpackConfig?.path &&
|
|
30
31
|
(0, devkit_1.joinPathFragments)(context.workspaceRoot, customWebpackConfig.path);
|
|
31
32
|
if (pathToWebpackConfig && !(0, fs_1.existsSync)(pathToWebpackConfig)) {
|
|
32
33
|
throw new Error(`Custom Webpack Config File Not Found!\nTo use a custom webpack config, please ensure the path to the custom webpack file is correct: \n${pathToWebpackConfig}`);
|
|
33
34
|
}
|
|
34
|
-
const
|
|
35
|
-
|
|
35
|
+
const normalizedIndexHtmlTransformer = indexHtmlTransformer ?? indexFileTransformer;
|
|
36
|
+
const pathToIndexFileTransformer = normalizedIndexHtmlTransformer &&
|
|
37
|
+
(0, devkit_1.joinPathFragments)(context.workspaceRoot, normalizedIndexHtmlTransformer);
|
|
36
38
|
if (pathToIndexFileTransformer && !(0, fs_1.existsSync)(pathToIndexFileTransformer)) {
|
|
37
39
|
throw new Error(`File containing Index File Transformer function Not Found!\n Please ensure the path to the file containing the function is correct: \n${pathToIndexFileTransformer}`);
|
|
38
40
|
}
|
|
@@ -42,7 +44,7 @@ function executeWebpackBrowserBuilder(options, context) {
|
|
|
42
44
|
projectGraph = (0, devkit_1.readCachedProjectGraph)();
|
|
43
45
|
const { tsConfigPath, dependencies: foundDependencies } = (0, buildable_libs_1.createTmpTsConfigForBuildableLibs)(delegateBuilderOptions.tsConfig, context, { projectGraph });
|
|
44
46
|
dependencies = foundDependencies;
|
|
45
|
-
delegateBuilderOptions.tsConfig = tsConfigPath;
|
|
47
|
+
delegateBuilderOptions.tsConfig = (0, devkit_1.normalizePath)((0, path_1.relative)(context.workspaceRoot, tsConfigPath));
|
|
46
48
|
}
|
|
47
49
|
return (0, rxjs_1.from)(Promise.resolve().then(() => require('@angular-devkit/build-angular'))).pipe((0, operators_2.switchMap)(({ executeBrowserBuilder }) => executeBrowserBuilder(delegateBuilderOptions, context, {
|
|
48
50
|
webpackConfiguration: (baseWebpackConfig) => {
|