Flat, round, designer-friendly pseudo-3D engine for canvas & SVG
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix broken regex for bundling

+11 -1
+11 -1
tasks/bundle.js
··· 4 4 // get file paths from index.js 5 5 const indexPath = 'js/index.js'; 6 6 let indexSrc = fs.readFileSync( `./${indexPath}`, 'utf8' ); 7 - let cjsBlockRegex = /module\.exports = factory\([\w ,'.\-()/\n]+;/i; 7 + // Updated regex to match the actual format 8 + let cjsBlockRegex = /module\.exports = factory\(([\s\S]*?)\);/i; 8 9 let cjsBlockMatch = indexSrc.match( cjsBlockRegex ); 10 + 11 + if (!cjsBlockMatch) { 12 + throw new Error('Could not find CommonJS module exports in index.js'); 13 + } 14 + 9 15 let paths = cjsBlockMatch[0].match( /require\('([.\-/\w]+)'\)/gi ); 16 + 17 + if (!paths) { 18 + throw new Error('Could not find any require statements in module exports'); 19 + } 10 20 11 21 paths = paths.map( function( path ) { 12 22 return path.replace( "require('.", 'js' ).replace( "')", '.js' );