diff --git a/scripts/build/ngx.ts b/scripts/build/ngx.ts index 48329a250..4506cb90c 100644 --- a/scripts/build/ngx.ts +++ b/scripts/build/ngx.ts @@ -57,7 +57,7 @@ export function generateDeclarationFiles() { // remove reference to @ionic-native/core decorators export function modifyMetadata() { - PLUGIN_PATHS.map(p => p.replace('src', 'dist').replace('index.ts', 'ngx/index.metadata.json')) + PLUGIN_PATHS.map(p => p.replace(path.join(ROOT, 'src'), path.join(ROOT, 'dist')).replace('index.ts', 'ngx/index.metadata.json')) .forEach(p => { const content = fs.readJSONSync(p); let _prop; diff --git a/scripts/tasks/build-esm.ts b/scripts/tasks/build-esm.ts index be7f7f723..afdd14219 100644 --- a/scripts/tasks/build-esm.ts +++ b/scripts/tasks/build-esm.ts @@ -1,7 +1,7 @@ import * as fs from 'fs-extra'; import * as path from 'path'; -import { PLUGIN_PATHS } from '../build/helpers'; +import { PLUGIN_PATHS, ROOT } from '../build/helpers'; import { EMIT_PATH } from '../build/transformers/extract-injectables'; import { generateDeclarations, transpile } from '../build/transpile'; @@ -9,7 +9,7 @@ generateDeclarations(); transpile(); const outDirs = PLUGIN_PATHS.map(p => - p.replace('src', 'dist').replace(/[\\/]index.ts/, '') + p.replace(path.join(ROOT, 'src'), path.join(ROOT, 'dist')).replace(/[\\/]index.ts/, '') ); const injectableClasses = fs.readJSONSync(EMIT_PATH);