mirror of
https://github.com/swc-project/swc.git
synced 2024-12-11 07:35:15 +03:00
31 lines
718 B
JavaScript
31 lines
718 B
JavaScript
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
const nodeModulesDirectory = path.join(
|
|
__dirname,
|
|
"..",
|
|
"..",
|
|
"..",
|
|
"node_modules"
|
|
);
|
|
/**
|
|
*
|
|
* @param {string} s
|
|
*/
|
|
function copy(s) {
|
|
console.log(`es/preset-env: Copying ${s}`);
|
|
|
|
const targetPath = path.join(__dirname, "..", "data", s);
|
|
const targetDir = path.dirname(targetPath);
|
|
|
|
fs.mkdirSync(targetDir, { recursive: true });
|
|
|
|
fs.copyFileSync(path.join(nodeModulesDirectory, s), targetPath);
|
|
}
|
|
|
|
copy("@babel/compat-data/data/plugins.json");
|
|
copy("@babel/compat-data/data/plugin-bugfixes.json");
|
|
copy("core-js-compat/data.json");
|
|
copy("core-js-compat/entries.json");
|
|
copy("core-js-compat/modules-by-versions.json");
|