mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix file path separator compatibility in scripts/babel (#24318)
The problem in scripts\babel\transform-object-assign.js is that file path separator has '/' and '\' between Linux, MacOS and Windows, which causes yarn build error. See https://github.com/facebook/react/issues/24103
This commit is contained in:
@@ -28,7 +28,7 @@ module.exports = function autoImporter(babel) {
|
||||
|
||||
visitor: {
|
||||
CallExpression: function(path, file) {
|
||||
if (file.filename.indexOf('shared/assign') !== -1) {
|
||||
if (/shared(\/|\\)assign/.test(file.filename)) {
|
||||
// Don't replace Object.assign if we're transforming shared/assign
|
||||
return;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ module.exports = function autoImporter(babel) {
|
||||
},
|
||||
|
||||
MemberExpression: function(path, file) {
|
||||
if (file.filename.indexOf('shared/assign') !== -1) {
|
||||
if (/shared(\/|\\)assign/.test(file.filename)) {
|
||||
// Don't replace Object.assign if we're transforming shared/assign
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user