mirror of
https://github.com/SwingTheVine/Wplace-BlueMarble.git
synced 2026-04-20 14:22:05 +00:00
30 lines
No EOL
786 B
JavaScript
30 lines
No EOL
786 B
JavaScript
/** Builds the userscript using esbuild.
|
|
* This is for compiling all of the source files into a single userscript file.
|
|
* @since 0.0.6
|
|
*/
|
|
|
|
import esbuild from 'esbuild';
|
|
import fs from 'fs';
|
|
import { execSync } from 'child_process';
|
|
|
|
try {
|
|
const update = execSync('node build/update-version.js', { stdio: 'inherit' });
|
|
console.log('Version updated in meta file successfully');
|
|
} catch (error) {
|
|
console.error('Failed to update version number:', error);
|
|
process.exit(1);
|
|
}
|
|
|
|
const metaContent = fs.readFileSync('src/BlueMarble.meta.js', 'utf8');
|
|
|
|
esbuild.build({
|
|
entryPoints: ['src/main.js'],
|
|
bundle: true,
|
|
outfile: 'dist/BlueMarble.user.js',
|
|
format: 'iife',
|
|
banner: {
|
|
js: metaContent
|
|
},
|
|
legalComments: 'inline',
|
|
minify: true
|
|
}).catch(() => process.exit(1)); |