-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Several parts of the plugin code make assumptions about the target names, which may not always be true. In some cases, the plugin provides an override option; in other cases, it does not.
We should probably externalize target name configurations (just like many other Nx plugins), to make the plugin easier to use in different workspace setups. For example, the @nx/webpack/plugin provides these plugin options:
{
"plugin": "@nx/webpack/plugin",
"options": {
"buildTargetName": "build",
"serveTargetName": "serve",
"previewTargetName": "preview",
"buildDepsTargetName": "build-deps",
"watchDepsTargetName": "watch-deps"
}
}
Nx by default often configures plugin targets prefixed with the tool name, e.g. webpack:build, vite:build, etc.
Known assumptions in our codebase:
Package executor
(override option via resourceOutputPathMap)
nx-forge/packages/nx-forge/src/executors/build/lib/process-resource-dependencies.ts
Line 93 in ae46099
| target: 'build', |
Tunnel executor
| { project: config.projectName, target: 'serve' }, |
Challanges
- Tunnel executor: If different Custom UIs use different bundlers, e.g., one with webpack and target name
webpack:serveand one with vite andvite:serve, then setting the target name at the plugin level won't help. In this case, the user would have to ensure each Custom UI project has aservetarget. They could achieve that by configuring aservetarget in eachproject.jsonand mapping it to the desired executor. In this case, externalizing this may not make sense.