MSBuild integration for Dataverse web resource (JavaScript/TypeScript) projects. Automatically runs npm install and npm run build when a TypeScript project is detected, copies the compiled JS output to the build output directory, and exposes metadata targets that allow Solution projects to discover and integrate script libraries as web resources.
<PackageReference Include="TALXIS.DevKit.Build.Dataverse.ScriptLibrary" Version="0.0.0.1" PrivateAssets="All" />Or use the SDK approach:
<Project Sdk="TALXIS.DevKit.Build.Sdk/0.0.0.1">
<PropertyGroup>
<ProjectType>ScriptLibrary</ProjectType>
</PropertyGroup>
</Project>When RunNodeBuild is true (auto-detected from the presence of package.json in TypeScriptDir):
- Node.js must be available on
PATH - npm must be available on
PATH
The build will fail with a descriptive error if either is missing.
The package sets ProjectType to ScriptLibrary and disables GenerateAssemblyInfo by default since this is not a traditional .NET assembly project.
- CheckScriptLibraryPrereqs -- validates that
TypeScriptDirexists,package.jsonis present, andnode/npmare onPATH. - BuildTypeScript (runs before
Build) -- executesnpm installfollowed bynpm run buildinTypeScriptDir. - CopyScriptLibraryMainToOutput (runs after
Build) -- copies the main JS file fromTypeScriptDir\build\to the output directory.
Called by TALXIS.DevKit.Build.Dataverse.Solution via ProjectReference:
- GetProjectType -- returns
ScriptLibrary. - GetScriptLibraryOutputs -- exposes the compiled JS file path for the solution to copy into
WebResources/.
| Property | Default | Description |
|---|---|---|
ProjectType |
ScriptLibrary |
Marks the project for reference discovery by Solution projects. |
RunNodeBuild |
Auto-detected | Set to true to run npm install and npm run build. Defaults to true if package.json exists in TypeScriptDir. |
TypeScriptDir |
$(MSBuildProjectDirectory)\TS |
Folder containing the TypeScript project (package.json, sources). |
ScriptLibraryMainFile |
(none) | Main script file path used by consuming targets. |
LangVersion |
latest |
C# language version for the project. |
GenerateAssemblyInfo |
false |
Disables auto-generated assembly info. |
- Depends on:
TALXIS.DevKit.Build.Dataverse.Tasks - Consumed by:
TALXIS.DevKit.Build.Dataverse.Solutionprojects viaProjectReference