Merge pull request #752 from friday/gulp-fix

Enable gulp builds when aws.json isn't present.
This commit is contained in:
Sam Potts 2018-01-08 12:12:11 +11:00 committed by GitHub
commit 9872207e87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,11 @@ const resolve = require('rollup-plugin-node-resolve');
const bundles = require('./bundles.json');
const pkg = require('./package.json');
const aws = require('./aws.json');
let aws;
try {
aws = require('./aws.json');
} catch (err) {}
// Paths
const root = __dirname;
@ -240,7 +244,7 @@ const options = {
};
// If aws is setup
if ('cdn' in aws) {
if (aws && 'cdn' in aws) {
const regex = '(?:0|[1-9][0-9]*)\\.(?:0|[1-9][0-9]*).(?:0|[1-9][0-9]*)(?:-[\\da-z\\-]+(?:.[\\da-z\\-]+)*)?(?:\\+[\\da-z\\-]+(?:.[\\da-z\\-]+)*)?';
const cdnpath = new RegExp(`${aws.cdn.domain}/${regex}`, 'gi');
const semver = new RegExp(`v${regex}`, 'gi');