Skip to content

Commit 1094471

Browse files
committed
Azure DevOps Extension v0.1.4 - Module Issue Fixed!
The Fix: Added package.json with "type": "commonjs" in the task directory This tells Node.js to treat the index.js file as CommonJS instead of ES modules Azure DevOps can now properly execute the bundled code
1 parent 0970fa8 commit 1094471

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "commonjs"
3+
}

component-detection-github-submission-task/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"version": {
1010
"Major": 0,
1111
"Minor": 1,
12-
"Patch": 3
12+
"Patch": 4
1313
},
1414
"instanceNameFormat": "Component Detection $(filePath)",
1515
"groups": [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"prepare": "ncc build index.ts -o dist --source-map --license licenses.txt",
1010
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
1111
"all": "npm run lint && npm run prepare && npm run test",
12-
"ado:build": "ncc build ado-index.ts -o ado-dist --source-map --license licenses.txt && node -e \"require('fs').copyFileSync('ado-dist/index.js', 'component-detection-github-submission-task/index.js')\"",
12+
"ado:build": "ncc build ado-index.ts -o ado-dist --source-map --license licenses.txt --target es2020 && node -e \"require('fs').copyFileSync('ado-dist/index.js', 'component-detection-github-submission-task/index.js')\"",
1313
"ado:package": "tfx extension create --manifest-globs vss-extension.json",
1414
"ado:all": "npm run ado:build && npm run ado:package"
1515
},

vss-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifestVersion": 1,
33
"id": "component-detection-github-submission-task",
44
"name": "Component Detection for GitHub Dependency Submission",
5-
"version": "0.1.3",
5+
"version": "0.1.4",
66
"publisher": "AdvancedSecurityOSS",
77
"description": "Upload information about your dependencies to the GitHub dependency graph using Microsoft's component detection library",
88
"public": false,

0 commit comments

Comments
 (0)