build(docs-infra): avoid Karma error when loading scripts from code.angularjs.org (#36015)
In the example apps used in the `ngUpgrade` guide, the AngularJS files are loaded in `index.html` from `https://code.angularjs.org/`. Latest browsers prevent loading the scripts from a page running on localhost due to CORS: ``` Access to script at 'https://code.angularjs.org/1.5.5/angular.js' from origin 'http://localhost:9876' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. ``` NOTE: Loading the files from `code.angularjs.org` is not mentioned in the guide, therefore it is not needed to mention this config change there. PR Close #36015
This commit is contained in:
parent
21b8d6956a
commit
5a7ac8c3b9
|
@ -16,6 +16,15 @@ module.exports = function(config) {
|
|||
'**/*.spec.js'
|
||||
],
|
||||
|
||||
// This is needed, because the AngularJS files are loaded from `https://code.angularjs.org/`.
|
||||
// Without this, latest browsers prevent loading the scripts from localhost with:
|
||||
// ```
|
||||
// Access to script at 'https://code.angularjs.org/1.5.5/angular.js' from origin
|
||||
// 'http://localhost:9876' has been blocked by CORS policy: No 'Access-Control-Allow-Origin'
|
||||
// header is present on the requested resource.
|
||||
// ```
|
||||
crossOriginAttribute: false,
|
||||
|
||||
autoWatch: true,
|
||||
|
||||
frameworks: ['jasmine'],
|
||||
|
|
|
@ -44,12 +44,21 @@ module.exports = function(config) {
|
|||
// #enddocregion files
|
||||
],
|
||||
|
||||
// This is needed, because the AngularJS files are loaded from `https://code.angularjs.org/`.
|
||||
// Without this, latest browsers prevent loading the scripts from localhost with:
|
||||
// ```
|
||||
// Access to script at 'https://code.angularjs.org/1.5.5/angular.js' from origin
|
||||
// 'http://localhost:9876' has been blocked by CORS policy: No 'Access-Control-Allow-Origin'
|
||||
// header is present on the requested resource.
|
||||
// ```
|
||||
crossOriginAttribute: false,
|
||||
|
||||
// #docregion html
|
||||
// proxied base paths for loading assets
|
||||
proxies: {
|
||||
// required for component assets fetched by Angular's compiler
|
||||
"/phone-detail": '/base/app/phone-detail',
|
||||
"/phone-list": '/base/app/phone-list'
|
||||
'/phone-detail': '/base/app/phone-detail',
|
||||
'/phone-list': '/base/app/phone-list'
|
||||
},
|
||||
// #enddocregion html
|
||||
|
||||
|
|
Loading…
Reference in New Issue