diff --git a/projects/angular/projects/cds-angular/_stubs/ng-package.json.mustache b/projects/angular/projects/cds-angular/_stubs/ng-package.json.mustache new file mode 100644 index 000000000..1af4d4af3 --- /dev/null +++ b/projects/angular/projects/cds-angular/_stubs/ng-package.json.mustache @@ -0,0 +1,6 @@ +{ + "lib": { + "entryFile": "public-api.ts", + "flatModuleFile": "{{{moduleFileName}}}" + } +} \ No newline at end of file diff --git a/projects/angular/projects/cds-angular/_stubs/package.json.mustache b/projects/angular/projects/cds-angular/_stubs/package.json.mustache index 4e96cf116..2478de6d1 100644 --- a/projects/angular/projects/cds-angular/_stubs/package.json.mustache +++ b/projects/angular/projects/cds-angular/_stubs/package.json.mustache @@ -1,9 +1,3 @@ { - "name": "@cds/angular/{{{moduleDirectory}}}", - "ngPackage": { - "lib": { - "entryFile": "public-api.ts", - "flatModuleFile": "{{{moduleFileName}}}" - } - } + "name": "@cds/angular/{{{moduleDirectory}}}" } diff --git a/projects/angular/scripts/core-ng-module-generator.js b/projects/angular/scripts/core-ng-module-generator.js index 9743d6a62..cf7421a3a 100644 --- a/projects/angular/scripts/core-ng-module-generator.js +++ b/projects/angular/scripts/core-ng-module-generator.js @@ -20,6 +20,7 @@ const directiveTemplate = fs.readFileSync(MUSTACHE_TEMPLTATE_PATH + '/directive. const moduleTemplate = fs.readFileSync(MUSTACHE_TEMPLTATE_PATH + '/module.ts.mustache', 'utf8'); const indexTemplate = fs.readFileSync(MUSTACHE_TEMPLTATE_PATH + '/index.ts.mustache', 'utf8'); const packageTemplate = fs.readFileSync(MUSTACHE_TEMPLTATE_PATH + '/package.json.mustache', 'utf8'); +const ngPackageTemplate = fs.readFileSync(MUSTACHE_TEMPLTATE_PATH + '/ng-package.json.mustache', 'utf8'); const publicAPITemplate = fs.readFileSync(MUSTACHE_TEMPLTATE_PATH + '/public-api.ts.mustache', 'utf8'); const rootIndexTemplate = fs.readFileSync(MUSTACHE_TEMPLTATE_PATH + '/root-index.ts.mustache', 'utf8'); const rootModuleTemplate = fs.readFileSync(MUSTACHE_TEMPLTATE_PATH + '/root-module.ts.mustache', 'utf8'); @@ -41,6 +42,7 @@ function createEntryPoints(modules) { const indexFilePath = path.resolve(TARGET_PATH, path.join(moduleDirectory, 'index.ts')); const publicAPIFilePath = path.resolve(TARGET_PATH, path.join(moduleDirectory, 'public-api.ts')); const packageFilePath = path.resolve(TARGET_PATH, path.join(moduleDirectory, 'package.json')); + const ngPackageFilePath = path.resolve(TARGET_PATH, path.join(moduleDirectory, 'ng-package.json')); const moduleClassName = createModuleClassName(module); const directives = elements.map(element => createDirective(element, module)); @@ -50,6 +52,7 @@ function createEntryPoints(modules) { moduleFilePath, moduleClassName, packageFilePath, + ngPackageFilePath, indexFilePath, publicAPIFilePath, directives, @@ -76,6 +79,7 @@ function writeComponentSubModules(modules) { writeToDisk(module.moduleFilePath, `${licenseHeader}${Mustache.render(moduleTemplate, module)}`); writeToDisk(module.indexFilePath, `${licenseHeader}${Mustache.render(indexTemplate, module)}`); writeToDisk(module.packageFilePath, Mustache.render(packageTemplate, module)); + writeToDisk(module.ngPackageFilePath, Mustache.render(ngPackageTemplate, module)); writeToDisk(module.publicAPIFilePath, `${licenseHeader}${Mustache.render(publicAPITemplate)}`); module.directives.forEach(directive => writeToDisk(directive.directiveFilePath, `${licenseHeader}${Mustache.render(directiveTemplate, directive)}`)