| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 42f4c9a commit d4f2fcd
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,28 +1,26 @@ | |||
| 1 | 1 | #!/usr/bin/env node | |
| 2 | 2 | ||
| 3 | 3 | const esbuild = require('esbuild'); | |
| 4 | - const fs = require('fs'); | ||
| 5 | 4 | const path = require('path'); | |
| 6 | 5 | ||
| 7 | 6 | // Check if we're building for production | |
| 8 | 7 | // (Set via passing `production` as first argument) | |
| 9 | 8 | const isProd = process.argv[2] === 'production'; | |
| 10 | 9 | ||
| 11 | 10 | // Gather our input files | |
| 12 | - const jsInDir = path.join(__dirname, '../../resources/js'); | ||
| 13 | - const jsInDirFiles = fs.readdirSync(jsInDir, 'utf8'); | ||
| 14 | - const entryFiles = jsInDirFiles | ||
| 15 | - .filter(f => f.endsWith('.js') || f.endsWith('.mjs')) | ||
| 16 | - .map(f => path.join(jsInDir, f)); | ||
| 11 | + const entryPoints = { | ||
| 12 | + app: path.join(__dirname, '../../resources/js/app.js'), | ||
| 13 | + code: path.join(__dirname, '../../resources/js/code/index.mjs'), | ||
| 14 | + }; | ||
| 17 | 15 | ||
| 18 | 16 | // Locate our output directory | |
| 19 | - const outDir = path.join(__dirname, '../../public/dist'); | ||
| 17 | + const outdir = path.join(__dirname, '../../public/dist'); | ||
| 20 | 18 | ||
| 21 | 19 | // Build via esbuild | |
| 22 | 20 | esbuild.build({ | |
| 23 | 21 | bundle: true, | |
| 24 | - entryPoints: entryFiles, | ||
| 25 | - outdir: outDir, | ||
| 22 | + entryPoints, | ||
| 23 | + outdir, | ||
| 26 | 24 | sourcemap: true, | |
| 27 | 25 | target: 'es2020', | |
| 28 | 26 | mainFields: ['module', 'main'], | |
| Back | FazBrowse Home | New Git URL |
0 commit comments