Skip to content

Commit

Permalink
Bump esbuild and plugins.
Browse files Browse the repository at this point in the history
  • Loading branch information
dom111 committed May 9, 2024
1 parent a3262af commit cb3234e
Show file tree
Hide file tree
Showing 10 changed files with 4,693 additions and 3,140 deletions.
2 changes: 1 addition & 1 deletion dist/css/app.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/css/app.css.map

Large diffs are not rendered by default.

118 changes: 61 additions & 57 deletions dist/js/app.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/js/app.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/js/langs/javascript-browser/worker.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/js/langs/webperl-5.28.1/worker.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 0 additions & 49 deletions esbuild.js

This file was deleted.

59 changes: 59 additions & 0 deletions esbuild.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { build, context } from 'esbuild';
import { sassPlugin } from 'esbuild-sass-plugin';

const watching = process.argv.includes('watch'),
buildOptions = {
entryPoints: [
'js/app.ts',
'css/app.scss',
'js/langs/javascript-browser/worker.js',
'js/langs/php-wasm/worker.ts',
'js/langs/python-wasmer/worker.ts',
'js/langs/webperl-5.28.1/worker.js',
],
bundle: true,
minify: true,
sourcemap: true,
outdir: 'dist',
plugins: [sassPlugin(), {
name: 'on-end',
setup(build) {
build.onEnd((result) => {
if (!watching) {
return;
}

if (result.errors.length) {
console.log('\x1b[31mError rebuilding:\x1b[0m');
console.error(result.errors);

return;
}

console.log('\x1b[32mRebuilt.\x1b[0m');
});
}
}],
entryNames: '[dir]/[name]',
};

if (watching) {
const builder = await context(buildOptions);

await builder.watch();
}
else {
process.stdout.write(`Building... `);

build(buildOptions)
.then(() => {
console.log('\x1b[32mdone.\x1b[0m');
})
.catch((e) => {
console.log(`\x1b[31mfailed.\x1b[0m`);
console.log('');
console.error(e);

process.exit(1);
});
}
Loading

0 comments on commit cb3234e

Please sign in to comment.