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-plugindeleteFiles->delete-files-pluginrunScript->run-script-pluginnodeService->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:
nodeServicewas always enabled, but would have no effect unless Heft was in watch mode (heft start)- If
config/node-service.jsonwas omitted, the plugin would silently be disabled
New behavior:
nodeServiceis always loaded by@rushstack/heft-node-rigbut for a customheft.jsonyou need to load it manuallynodeServicehas no effect unless you specify--serve, for example:heft build-watch --serve- If
--serveis specified andconfig/node-service.jsonis 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-rigor@rushstack/heft-web-rig, the Jest plugin is already enabled. Skip to step 4. -
Add the
@rushstack/heft-jest-plugindependency to your project's package.json file. -
Load the plugin by adding this setting to your
config/heft.jsonfile:{ "heftPlugins": [ { "plugin": "@rushstack/heft-jest-plugin" } ] }
-
Update your
config/jest.config.jsonfile, replacing thepresetfield with an equivalentextendsfield. 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.jsonhas moved to a different folderconfig/typescript.json. Going forward config files will no longer be stored in the hidden.heftfolder. -
The
emitFolderNameForJestsetting intypescript.jsonhas been renamed toemitFolderNameForTests -
clean.jsonhas 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.jsonfile 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.jsonhas 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.jsonfile like this:config/typescript.json (NEW)
{ "$schema": "https://developer.microsoft.com/json-schemas/heft/typescript.schema.json", . . . "staticAssetsToCopy": { "fileExtensions": [".css", ".png"] } }
-
plugins.jsonhas 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.jsonfile 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.