-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Hello,
When running in an angular workspace, the ng-add command can recognize the proper project for the modifications of the angular.json file.
But for the env.d.ts file, this is only a use of src folder, which makes that you have to move the file.
The following move function could use the project path :
export default function (options: any): Rule {
return chain([
mergeWith(apply(url("./template"), [move(normalize("./src"))])),
builder(options),
]);
}
This can be helpful when we want to call the schematics from another schematics with externalSchematic method, giving the project as argument :
function addNgxEnvBuilder(): Rule {
return (tree: Tree, context: SchematicContext) => {
context.logger.log('info', `🛠 Adding ngx-env builder...`);
return externalSchematic('@ngx-env/builder', 'ng-add', {
project: 'sandbox' //or options.project for example
})(tree, context);
}
}
Cheers !
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request