mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 19:22:32 +03:00
27 lines
690 B
JavaScript
27 lines
690 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")
|