We'll build the app we just created, and look at what executors are and how to customize them.
- Understand what a
target
andexecutor
are - Invoking executors
- Configure executors by passing them different options
- Understand how an executor can invoke another executor
-
Build the app
-
You should now have a
dist
folder - let's open it up!- This is your whole app's output! If we wanted we could push this now to a server and it would all work.
- Open one of the files, for example
main.js
and look at it's contents
-
Open up
workspace.json
and look at the object underprojects/store/targets/build
- this is the target, and it has an executor option, that points to
@nrwl/web:build
- Remember how we copied some images into our
/assets
folder earlier? Look through the executor options and try to find how it knows to include them in the final build!
- this is the target, and it has an executor option, that points to
-
Send a flag to the executor so that it builds for production
🐳 Hint
--configuration=production
-
Open up the
dist
folder again - notice how we now generated a3rdpartylicenses.txt
file, as per the "production" configuration inworkspace.json
. Also notice how all filenames have hashed suffixes. Open one of the files, for examplemain.{hash}.js
. Notice how its content is now different.
- The serve target (located a bit lower in
workspace.json
) also contains a executor, that uses the output from the build target
🎓 If you get stuck, check out the solution