Skip to content

Commit

Permalink
facebook#22988 - Fix Bug: @license header in React 18 bundles contain…
Browse files Browse the repository at this point in the history
…s vundefined (facebook#23004)

* Fix Bug: @license header in React 18 bundles contains vundefined
* Remove React version from the header comment
  • Loading branch information
vitaliemiron authored and nevilm-lt committed Apr 22, 2022
1 parent 56f50b7 commit 9b4cb7c
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 9b4cb7c

Please sign in to comment.