fix(react): exposed the crossOrigin option for web builder options (#2830)

ISSUES CLOSED: 2419

Co-authored-by: danielji <daniel.ji@innovid.com>
This commit is contained in:
Daniel Ji 2020-05-29 08:04:08 -07:00 committed by GitHub
parent 416e3eb837
commit 25432a6395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 0 deletions

View File

@ -42,6 +42,12 @@ Type: `boolean`
Use a separate bundle containing code used across multiple bundles.
### crossOrigin
Type: `string`
The crossorigin attribute to use for generated javascript script tags. One of 'none' | 'anonymous' | 'use-credentials'
### deployUrl
Type: `string`

View File

@ -43,6 +43,12 @@ Type: `boolean`
Use a separate bundle containing code used across multiple bundles.
### crossOrigin
Type: `string`
The crossorigin attribute to use for generated javascript script tags. One of 'none' | 'anonymous' | 'use-credentials'
### deployUrl
Type: `string`

View File

@ -21,6 +21,7 @@ import {
calculateProjectDependencies,
createTmpTsConfig,
} from '@nrwl/workspace/src/utils/buildable-libs-utils';
import { CrossOriginValue } from '../../utils/third-party/cli-files/utilities/index-file/augment-index-html';
export interface WebBuildBuilderOptions extends BuildBuilderOptions {
index: string;
@ -29,6 +30,7 @@ export interface WebBuildBuilderOptions extends BuildBuilderOptions {
deployUrl: string;
extractCss?: boolean;
crossOrigin?: CrossOriginValue;
polyfills?: string;
es2015Polyfills?: string;
@ -150,6 +152,7 @@ export function run(options: WebBuildBuilderOptions, context: BuilderContext) {
const success = [result1, result2].every((result) => result.success);
return (options.optimization
? writeIndexHtml({
crossOrigin: options.crossOrigin,
host,
outputPath: devkitJoin(
normalize(options.outputPath),

View File

@ -3,6 +3,10 @@
"description": "Web application build target options for Build Facade",
"type": "object",
"properties": {
"crossOrigin": {
"type": "string",
"description": "The crossorigin attribute to use for generated javascript script tags. One of 'none' | 'anonymous' | 'use-credentials'"
},
"main": {
"type": "string",
"description": "The name of the main entry-point file."