* Get a list of all JS/TS files (using glob pattern) * @return {String[]} list of files
()
| 39 | * @return {String[]} list of files |
| 40 | */ |
| 41 | function getAllJSFiles() { |
| 42 | const allFiles = globSync(['src/**/*.{js,ts}']); |
| 43 | |
| 44 | // make sure "slick.core.js" (or .ts) is 1st file |
| 45 | // we do this because the Slick object gets created first by slick.core.js, then we can extend Slick afterward |
| 46 | allFiles.sort((a, b) => { |
| 47 | const wordToBeFirst = /slick.core.[jt]s/; |
| 48 | if (wordToBeFirst.test(a)) { |
| 49 | return -1; |
| 50 | } else if (wordToBeFirst.test(b)) { |
| 51 | return 1; |
| 52 | } |
| 53 | return a > b; |
| 54 | }); |
| 55 | |
| 56 | return allFiles; |
| 57 | } |
| 58 | |
| 59 | /** Execute full build of all format types (iife, cjs & esm) */ |
| 60 | export async function executeFullBuild() { |
no test coverage detected