Skip to content

Commit

Permalink
fix(nativescript): postinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWalker committed Jul 3, 2021
1 parent 6aadb85 commit a573d3a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ try {
}

// Helpful to trigger ngcc after an install to ensure all has processed properly
const child = childProcess.spawn(/^win/.test(process.platform) ? '<%= pathOffsetWindows %>node_modules\\.bin\\ngcc' : '<%= pathOffset %>node_modules/.bin/ngcc', ['--tsconfig', 'tsconfig.app.json', '--properties', 'es2015', 'module', 'main', '--first-only'], {
const relativePath = '<%= pathOffset %>'.split('/').filter(p => !!p);
const ngccPath = path.join(...relativePath, 'node_modules', '.bin', 'ngcc');
const child = childProcess.spawn(ngccPath, ['--tsconfig', 'tsconfig.app.json', '--properties', 'es2015', 'module', 'main', '--first-only'], {
cwd: process.cwd(),
stdio: 'inherit',
shell: process.platform == 'win32'
});
child.on('close', (code) => {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ try {
}

// Helpful to trigger ngcc after an install to ensure all has processed properly
const child = childProcess.spawn(/^win/.test(process.platform) ? '<%= pathOffsetWindows %>node_modules\\.bin\\ngcc' : '<%= pathOffset %>node_modules/.bin/ngcc', ['--tsconfig', 'tsconfig.app.json', '--properties', 'es2015', 'module', 'main', '--first-only'], {
const relativePath = '<%= pathOffset %>'.split('/').filter(p => !!p);
const ngccPath = path.join(...relativePath, 'node_modules', '.bin', 'ngcc');
const child = childProcess.spawn(ngccPath, ['--tsconfig', 'tsconfig.app.json', '--properties', 'es2015', 'module', 'main', '--first-only'], {
cwd: process.cwd(),
stdio: 'inherit',
shell: process.platform == 'win32'
});
child.on('close', (code) => {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ function addAppFiles(
appname,
directoryAppPath: `${directory}${appPath}`,
pathOffset: directory ? '../../../' : '../../',
pathOffsetWindows: directory ? '..\\..\\..\\' : '..\\..\\',
angularVersion: angularVersion,
nsNgScopedVersion: nsNgScopedVersion,
nsNgFonticonVersion: nsNgFonticonVersion,
Expand Down

0 comments on commit a573d3a

Please sign in to comment.