@deployjs/angular-build
Advanced tools
Comparing version 0.0.2 to 0.0.3
13
index.js
@@ -8,2 +8,3 @@ /*eslint-env node*/ | ||
const exec = require('child_process').exec; | ||
const execSync = require ('child_process').execSync; | ||
@@ -30,6 +31,16 @@ module.exports = { | ||
var regex = /Angular CLI: ([0-9])\./; | ||
var ngCliVersionBuffer = execSync('ng version').toString('utf-8') || ''; | ||
var substring = ngCliVersionBuffer.match(regex); | ||
var ngCliVersion = substring[1] || 1; | ||
var environmentOption = ngCliVersion >= 6 ? '--configuration=' : '--environment '; | ||
if (ngCliVersion >= 6 && buildEnv === 'prod') { | ||
buildEnv = 'production'; | ||
} | ||
this.log('building app to `' + outputPath + '` using buildEnv `' + buildEnv + '`...', { verbose: true }); | ||
return new RSVP.Promise(function(resolve, reject) { | ||
exec('ng build --environment ' + buildEnv + ' --output-path ' + outputPath + ' --output-hashing all' | ||
exec('ng build ' + environmentOption + buildEnv + ' --output-path ' + outputPath + ' --output-hashing all' | ||
+ (deployUrl ? ' --deploy-url=' + deployUrl : '') | ||
@@ -36,0 +47,0 @@ + (baseHref ? ' --base-href=' + baseHref : ''), |
{ | ||
"name": "@deployjs/angular-build", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Build Angular projects ready for deployment", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76
4633
4
2