append api to lib name

This commit is contained in:
Mads Rasmussen
2023-05-16 14:16:46 +02:00
parent d6d0c10e73
commit a8a4ea6a29
8 changed files with 9 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
// Load all .d.ts files from the dist/libs folder
// and replace all imports from @umbraco-cms/backoffice with relative imports
// Example: import { Foo } from '@umbraco-cms/backoffice/element' -> import { Foo } from './element'
// Example: import { Foo } from '@umbraco-cms/backoffice/element-api' -> import { Foo } from './element'
// This is needed because the d.ts files are not in the same folder as the source files
// and the absolute paths are not valid when the d.ts files are copied to the dist folder
// This is only used when building the d.ts files.
@@ -35,8 +35,7 @@ try {
}
// Transform all .d.ts files and copy all other files to the output folder
libs.forEach(lib => {
libs.forEach((lib) => {
if (lib.endsWith('.js') === false && lib.endsWith('.js.map') === false) return;
console.log(`Transforming ${lib}`);
@@ -55,5 +54,4 @@ libs.forEach(lib => {
writeFileSync(dtsFile, code, 'utf8');
cpSync(dtsFile, `${outputDir}/${lib}`, { recursive: true });
});