forked from Mirrors/OpenAsar
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
507 B
14 lines
507 B
const { readdirSync, copyFileSync, mkdirSync } = require('fs');
|
|
const { join } = require('path');
|
|
|
|
const rootDir = join(__dirname, '..');
|
|
const nodeModules = join(rootDir, 'src', 'node_modules');
|
|
mkdirSync(nodeModules, { recursive: true }); // Ensure node_modules exists
|
|
|
|
const polyfillsDir = join(rootDir, 'polyfills');
|
|
for (const file of readdirSync(polyfillsDir)) {
|
|
const [ name ] = file.split('.');
|
|
const jsPath = join(polyfillsDir, file);
|
|
|
|
copyFileSync(jsPath, join(nodeModules, name + '.js'));
|
|
} |