Migrating to the package executor
Since plugin version 5.1.0, the legacy Nx Forge build target has been replaced by a native Nx build in combination with the package target.
For all the details and motivation of this change, refer to the discussion on GitHub.
Migration steps
Ensure you are on the latest plugin version by running:
nx add @toolsplus/nx-forge@latest.Generate a new Forge app with the updated app generator. Make sure to set the
bundleroption to choose if thebuildtask should be run by Webpack or esbuild. You do not need to run thebuild,package, orregistertasks. Generating this Forge app will ensure you have the correct dependencies installed and your workspace is configured to work with Webpack or esbuild.a) If you chose the Webpack bundler option (default):
Copy the generated
webpack.config.jsto your app's project directory and update theoutputPath,main,tsConfig, andassetsvalues to match your project layout. The generated app uses the@nx/webpack/pluginentry innx.jsonto infer thebuildtarget, so you can delete the existingbuildtarget configuration from your app'sproject.json.If your workspace has inferred plugins disabled, keep an explicit
buildtarget instead. In that case, copy the generated app'sbuildtarget configuration fromproject.jsonand adjust the paths to match your project layout.b) If you chose the esbuild bundler option:
Copy the
buildtarget configuration from the generated app'sproject.jsonand replace the existingbuildtarget configuration in your app'sproject.json. Adjust the path configurations in thebuildtarget to match your project layout.Run
nx g @nx/workspace:remove --projectName=<genrated-forge-app>to remove the app generated in step 2.