fix build config to work the same when running on windows (#11688)
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
function normalize(src) {
|
||||
return src.replace(/\//, path.sep);
|
||||
}
|
||||
|
||||
module.exports = function (api) {
|
||||
const env = api.env();
|
||||
|
||||
@@ -91,7 +97,9 @@ module.exports = function (api) {
|
||||
"packages/*/test/fixtures",
|
||||
ignoreLib ? "packages/*/lib" : null,
|
||||
"packages/babel-standalone/babel.js",
|
||||
].filter(Boolean),
|
||||
]
|
||||
.filter(Boolean)
|
||||
.map(normalize),
|
||||
presets: [["@babel/env", envOpts]],
|
||||
plugins: [
|
||||
// TODO: Use @babel/preset-flow when
|
||||
@@ -113,14 +121,14 @@ module.exports = function (api) {
|
||||
test: [
|
||||
"packages/babel-parser",
|
||||
"packages/babel-helper-validator-identifier",
|
||||
],
|
||||
].map(normalize),
|
||||
plugins: [
|
||||
"babel-plugin-transform-charcodes",
|
||||
["@babel/transform-for-of", { assumeArray: true }],
|
||||
],
|
||||
},
|
||||
{
|
||||
test: ["./packages/babel-cli", "./packages/babel-core"],
|
||||
test: ["./packages/babel-cli", "./packages/babel-core"].map(normalize),
|
||||
plugins: [
|
||||
// Explicitly use the lazy version of CommonJS modules.
|
||||
convertESM
|
||||
@@ -129,11 +137,11 @@ module.exports = function (api) {
|
||||
].filter(Boolean),
|
||||
},
|
||||
{
|
||||
test: "./packages/babel-polyfill",
|
||||
test: normalize("./packages/babel-polyfill"),
|
||||
presets: [["@babel/env", envOptsNoTargets]],
|
||||
},
|
||||
{
|
||||
test: unambiguousSources,
|
||||
test: unambiguousSources.map(normalize),
|
||||
sourceType: "unambiguous",
|
||||
},
|
||||
includeRegeneratorRuntime && {
|
||||
|
||||
Reference in New Issue
Block a user