[Polyfill > Inject] Simplify by just making js files instead of dirs

This commit is contained in:
Ducko 2022-01-13 14:28:18 +00:00
parent bb5a36c4f6
commit 6d8c9f1197

View file

@ -1,4 +1,4 @@
const { readdirSync, mkdirSync, copyFileSync } = require('fs');
const { readdirSync, copyFileSync } = require('fs');
const { join } = require('path');
const rootDir = join(__dirname, '..');
@ -8,11 +8,5 @@ for (const file of readdirSync(polyfillsDir)) {
const [ name ] = file.split('.');
const jsPath = join(polyfillsDir, file);
const moduleDir = join(rootDir, 'src', 'node_modules', name);
try {
mkdirSync(moduleDir);
} catch (e) {}
copyFileSync(jsPath, join(moduleDir, 'index.js'));
copyFileSync(jsPath, join(rootDir, 'src', 'node_modules', name + '.js'));
}