mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-22 11:50:27 +08:00
Added esbuild bundle inspection metafile
This commit is contained in:
parent
f51036b203
commit
c148e2f3d9
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -21,8 +21,10 @@ yarn.lock
|
||||||
nbproject
|
nbproject
|
||||||
.buildpath
|
.buildpath
|
||||||
.project
|
.project
|
||||||
|
.nvmrc
|
||||||
.settings/
|
.settings/
|
||||||
webpack-stats.json
|
webpack-stats.json
|
||||||
.phpunit.result.cache
|
.phpunit.result.cache
|
||||||
.DS_Store
|
.DS_Store
|
||||||
phpstan.neon
|
phpstan.neon
|
||||||
|
esbuild-meta.json
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
const esbuild = require('esbuild');
|
const esbuild = require('esbuild');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
// Check if we're building for production
|
// Check if we're building for production
|
||||||
// (Set via passing `production` as first argument)
|
// (Set via passing `production` as first argument)
|
||||||
|
@ -19,6 +20,7 @@ const outdir = path.join(__dirname, '../../public/dist');
|
||||||
// Build via esbuild
|
// Build via esbuild
|
||||||
esbuild.build({
|
esbuild.build({
|
||||||
bundle: true,
|
bundle: true,
|
||||||
|
metafile: true,
|
||||||
entryPoints,
|
entryPoints,
|
||||||
outdir,
|
outdir,
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
|
@ -27,4 +29,6 @@ esbuild.build({
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
minify: isProd,
|
minify: isProd,
|
||||||
logLevel: "info",
|
logLevel: "info",
|
||||||
|
}).then(result => {
|
||||||
|
fs.writeFileSync('esbuild-meta.json', JSON.stringify(result.metafile));
|
||||||
}).catch(() => process.exit(1));
|
}).catch(() => process.exit(1));
|
Loading…
Reference in New Issue
Block a user