Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
chore(doc-gen): fix script paths in plnkr for examples with deps
Browse files Browse the repository at this point in the history
Closes #16238
  • Loading branch information
gkalpak committed Sep 22, 2017
1 parent 6e78fee commit 18b8a63
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions docs/config/services/deployments/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@ var angularCodeUrl = '//code.angularjs.org/';

var cdnUrl = googleCdnUrl + versionInfo.cdnVersion;

// The "examplesCdnUrl" here applies to the examples when they are opened in plnkr.co.
// The "examplesDependencyPath" here applies to the examples when they are opened in plnkr.co.
// The embedded examples instead always include the files from the *default* deployment,
// to ensure that the source files are always available.
// The plnkr examples must always use the code.angularjs.org source files.
// We cannot rely on the CDN files here, because they are not deployed during the same time
// as the docs app.
var examplesCdnUrl = versionInfo.currentVersion.isSnapshot ?
(angularCodeUrl + 'snapshot') :
(angularCodeUrl + (versionInfo.currentVersion.version || versionInfo.currentVersion.version));
// We cannot rely on the CDN files here, because they are not deployed by the time
// docs.angularjs.org and code.angularjs.org need them.
var versionPath = versionInfo.currentVersion.isSnapshot ?
'snapshot' :
(versionInfo.currentVersion.version || versionInfo.currentVersion.version);
var examplesDependencyPath = angularCodeUrl + versionPath + '/';

module.exports = function productionDeployment(getVersion) {
return {
name: 'production',
examples: {
commonFiles: {
scripts: [examplesCdnUrl + '/angular.min.js']
scripts: [examplesDependencyPath + 'angular.min.js']
},
dependencyPath: examplesCdnUrl
dependencyPath: examplesDependencyPath
},
scripts: [
cdnUrl + '/angular.min.js',
Expand Down

0 comments on commit 18b8a63

Please sign in to comment.