The taskEvent
configuration option in heft.json has been removed, and use of any taskEvent
-based functionality is now accomplished by referencing the plugins directly within the @rushstack/heft
package.
Plugin name mappings for previously-existing task events are:
copyFiles
->copy-files-plugin
deleteFiles
->delete-files-plugin
runScript
->run-script-plugin
nodeService
->node-service-plugin
Example diff of a heft.json file that uses the copyFiles
task event:
{
"phasesByName": {
"build": {
"tasksbyName": {
"perform-copy": {
- "taskEvent": {
- "eventKind": "copyFiles",
+ "taskPlugin": {
+ "pluginPackage": "@rushstack/heft",
+ "pluginName": "copy-files-plugin",
"options": {
...
}
}
}
}
}
}
}
The nodeService
built-in plugin now supports the --serve
parameter, to be consistent with the @rushstack/heft-webpack5-plugin
dev server.
Old behavior:
nodeService
was always enabled, but would have no effect unless Heft was in watch mode (heft start
)- If
config/node-service.json
was omitted, the plugin would silently be disabled
New behavior:
nodeService
is always loaded by@rushstack/heft-node-rig
but for a customheft.json
you need to load it manuallynodeService
has no effect unless you specify--serve
, for example:heft build-watch --serve
- If
--serve
is specified andconfig/node-service.json
is omitted, then Heft fails with a hard error
⭐ This release included significant breaking changes. ⭐
For details, please see our two blog posts:
This release of Heft removed the Sass plugin from the @rushstack/heft
package
and moved it into its own package (@rushstack/heft-sass-plugin
). To reenable
Sass support in a project, include a dependency on @rushstack/heft-sass-plugin
and add the following option to the project's config/heft.json
file:
{
"heftPlugins": [
{
"plugin": "@rushstack/heft-sass-plugin"
}
]
}
If you are using @rushstack/heft-web-rig
, upgrading the rig package will bring
Sass support automatically.
Breaking change for Jest: This release of Heft enables rig support for Jest config files.
It also reduces Heft's installation footprint by removing the Jest plugin from @rushstack/heft
and moving it to its own package @rushstack/heft-jest-plugin
. As a result, Jest is now
disabled by default.
To reenable Jest support for your project, follow these steps:
-
If you are using
@rushstack/heft-node-rig
or@rushstack/heft-web-rig
, the Jest plugin is already enabled. Skip to step 4. -
Add the
@rushstack/heft-jest-plugin
dependency to your project's package.json file. -
Load the plugin by adding this setting to your
config/heft.json
file:{ "heftPlugins": [ { "plugin": "@rushstack/heft-jest-plugin" } ] }
-
Update your
config/jest.config.json
file, replacing thepreset
field with an equivalentextends
field. This enables Heft to perform module resolution with support for rigs.For example, this setting...
{ "preset": "./node_modules/@rushstack/heft/includes/jest-shared.config.json" }
...should be changed to this:
{ "extends": "@rushstack/heft-jest-plugin/includes/jest-shared.config.json" }
As another example, if you are using a rig, then this...
{ "preset": "./node_modules/@rushstack/heft-web-rig/profiles/library/config/jest.config.json" }
...should be changed to this:
{ "extends": "@rushstack/heft-web-rig/profiles/library/config/jest.config.json" }
This extends
field is a Heft-specific enhancement that will not work if the Jest command line
is invoked without Heft. (Doing so was not generally useful; in our configuration Jest relies
on Heft to invoke the compiler and any other preprocessing steps.)
If for some reason your jest.config.json
needs to be directly readable by Jest, the
disableConfigurationModuleResolution
setting can be used to restore the old behavior.
For example:
{
"heftPlugins": [
{
"plugin": "@rushstack/heft-jest-plugin",
"options": {
// (Not recommended) Disable Heft's support for rigs and the "extends" field
"disableConfigurationModuleResolution": true
}
}
]
}
This release of Heft removed the Webpack plugins from the @rushstack/heft
package
and moved them into their own package (@rushstack/heft-webpack4-plugin
). To reenable
Webpack support in a project, include a dependency on @rushstack/heft-webpack4-plugin
and add the following option to the project's config/heft.json
file:
{
"heftPlugins": [
{
"plugin": "@rushstack/heft-webpack4-plugin"
}
]
}
If you are using @rushstack/heft-web-rig
, upgrading the rig package will bring
Webpack support automatically.
This release of Heft consolidated several config files and introduced support for rig packages.
The major changes were:
-
.heft/typescript.json
has moved to a different folderconfig/typescript.json
. Going forward config files will no longer be stored in the hidden.heft
folder. -
The
emitFolderNameForJest
setting intypescript.json
has been renamed toemitFolderNameForTests
-
clean.json
has been removed. If your file previously looked like this:.heft/clean.json (OLD)
{ "$schema": "https://developer.microsoft.com/json-schemas/heft/clean.schema.json", "pathsToDelete": ["dist", "lib", "temp"] }
...these settings are now specified in the new
heft.json
file like this:config/heft.json (NEW)
{ "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", "eventActions": [ { "actionKind": "deleteGlobs", "heftEvent": "clean", "actionId": "defaultClean", "globsToDelete": ["dist", "lib", "temp"] } ] . . . }
-
copy-static-assets.json
has been removed. If your file previously looked like this:.heft/copy-static-assets.json (OLD)
{ "$schema": "https://developer.microsoft.com/json-schemas/heft/copy-static-assets.schema.json", "fileExtensions": [".css", ".png"] }
...these settings are now specified in the
typescript.json
file like this:config/typescript.json (NEW)
{ "$schema": "https://developer.microsoft.com/json-schemas/heft/typescript.schema.json", . . . "staticAssetsToCopy": { "fileExtensions": [".css", ".png"] } }
-
plugins.json
has been removed. If your file previously looked like this:.heft/plugins.json (OLD)
{ "$schema": "https://developer.microsoft.com/json-schemas/heft/plugins.schema.json", "plugins": [ { "plugin": "path/to/my-plugin", } ] }
...these settings are now specified in the
heft.json
file like this:config/heft.json (NEW)
{ "$schema": "https://developer.microsoft.com/json-schemas/heft/typescript.schema.json", . . . "heftPlugins": [ { "plugin": "path/to/my-plugin", } ] }
Complete documentation for Heft config file formats can be found on the project website.