OpenAsar/scripts/injectPolyfills.js

12 lines
382 B
JavaScript
Raw Normal View History

const { readdirSync, copyFileSync } = require('fs');
2021-12-11 00:45:56 +00:00
const { join } = require('path');
const rootDir = join(__dirname, '..');
const polyfillsDir = join(rootDir, 'polyfills');
2021-12-11 00:45:56 +00:00
for (const file of readdirSync(polyfillsDir)) {
const [ name ] = file.split('.');
const jsPath = join(polyfillsDir, file);
copyFileSync(jsPath, join(rootDir, 'src', 'node_modules', name + '.js'));
2021-12-11 00:45:56 +00:00
}