I am currently developing a series of VSTS extensions, with each extension being its own independent Node project complete with its own package.json
file and node_modules
folder. The structure of the folders is as follows:
- MyExtension
- package.json // containing all development dependencies
- tslint.json
- Tasks
- tsconfig.json
- Common
- common.ts // contains shared functionality across tasks
- package.json // includes runtime dependencies for all projects
- My1stTask
- package.json // holds production dependencies
- task.ts // implementation of the task
- ...
- ...
- My6thTask
- package.json // holds production dependencies
- task.ts // implementation of the task
In order to fully separate VSTS build tasks, I have been duplicating the contents of the Common
project into each task and then running tsc
to convert them all to JavaScript.
While this method has worked, it requires constant copying of content from Common for testing purposes.
I attempted to use local file references by adding a dependency in each task's package.json to file:../common
, which functions during development but doesn't include the common module in the task after generating the extension.
Coming from a C# background rather than Node development, I have searched extensively for a solution that integrates well with vsts-extensions.
npm pack
does not seem to function as expected, as the extension demands that all files be present.package.json/bundleDependencies
shows promise but does not bundle the local file reference.
works nicely for editing but fails to run after building the extension.///<reference path="../common/common.ts"/>
- Project reference with prepend does not work, as build tasks require the commonjs module resolver. Systems and AMD are unable to load modules, and prepend only functions with the latter.
Is there a way to seamlessly make this setup work without resorting to bower or grunt, and simply ensuring that each MyXthTask has a copy of the local common module in their node_modules
folder?