[Polyfill > Inject] Simplify by just making js files instead of dirs
This commit is contained in:
		
							parent
							
								
									bb5a36c4f6
								
							
						
					
					
						commit
						6d8c9f1197
					
				
					 1 changed files with 2 additions and 8 deletions
				
			
		|  | @ -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')); | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue