Skip to content

Commit

Permalink
#22988 - Fix Bug: @license header in React 18 bundles contains vundef…
Browse files Browse the repository at this point in the history
…ined (#23004)

* Fix Bug: @license header in React 18 bundles contains vundefined
* Remove React version from the header comment
  • Loading branch information
vitaliemiron authored Dec 21, 2021
1 parent a4ead70 commit bd0a5dd
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions scripts/rollup/wrappers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const {resolve} = require('path');
const {readFileSync} = require('fs');
const {bundleTypes, moduleTypes} = require('./bundles');
const reactVersion = require('../../package.json').version;

const {
NODE_ES2015,
Expand Down Expand Up @@ -54,7 +53,8 @@ const license = ` * Copyright (c) Facebook, Inc. and its affiliates.
const wrappers = {
/***************** NODE_ES2015 *****************/
[NODE_ES2015](source, globalName, filename, moduleType) {
return `/** @license React v${reactVersion}
return `/**
* @license React
* ${filename}
*
${license}
Expand All @@ -67,7 +67,8 @@ ${source}`;

/***************** NODE_ESM *****************/
[NODE_ESM](source, globalName, filename, moduleType) {
return `/** @license React v${reactVersion}
return `/**
* @license React
* ${filename}
*
${license}
Expand All @@ -78,7 +79,8 @@ ${source}`;

/***************** UMD_DEV *****************/
[UMD_DEV](source, globalName, filename, moduleType) {
return `/** @license React v${reactVersion}
return `/**
* @license React
* ${filename}
*
${license}
Expand All @@ -88,7 +90,8 @@ ${source}`;

/***************** UMD_PROD *****************/
[UMD_PROD](source, globalName, filename, moduleType) {
return `/** @license React v${reactVersion}
return `/**
* @license React
* ${filename}
*
${license}
Expand All @@ -98,7 +101,8 @@ ${license}

/***************** UMD_PROFILING *****************/
[UMD_PROFILING](source, globalName, filename, moduleType) {
return `/** @license React v${reactVersion}
return `/**
* @license React
* ${filename}
*
${license}
Expand All @@ -108,7 +112,8 @@ ${license}

/***************** NODE_DEV *****************/
[NODE_DEV](source, globalName, filename, moduleType) {
return `/** @license React v${reactVersion}
return `/**
* @license React
* ${filename}
*
${license}
Expand All @@ -125,7 +130,8 @@ ${source}

/***************** NODE_PROD *****************/
[NODE_PROD](source, globalName, filename, moduleType) {
return `/** @license React v${reactVersion}
return `/**
* @license React
* ${filename}
*
${license}
Expand All @@ -135,7 +141,8 @@ ${source}`;

/***************** NODE_PROFILING *****************/
[NODE_PROFILING](source, globalName, filename, moduleType) {
return `/** @license React v${reactVersion}
return `/**
* @license React
* ${filename}
*
${license}
Expand Down Expand Up @@ -294,7 +301,8 @@ ${source}`;
const reconcilerWrappers = {
/***************** NODE_DEV (reconciler only) *****************/
[NODE_DEV](source, globalName, filename, moduleType) {
return `/** @license React v${reactVersion}
return `/**
* @license React
* ${filename}
*
${license}
Expand All @@ -313,7 +321,8 @@ ${source}

/***************** NODE_PROD (reconciler only) *****************/
[NODE_PROD](source, globalName, filename, moduleType) {
return `/** @license React v${reactVersion}
return `/**
* @license React
* ${filename}
*
${license}
Expand All @@ -327,7 +336,8 @@ ${source}

/***************** NODE_PROFILING (reconciler only) *****************/
[NODE_PROFILING](source, globalName, filename, moduleType) {
return `/** @license React v${reactVersion}
return `/**
* @license React
* ${filename}
*
${license}
Expand Down

0 comments on commit bd0a5dd

Please sign in to comment.