1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-22 15:54:57 +00:00
transmission/web/esbuild.mjs

24 lines
541 B
JavaScript

import * as esbuild from 'esbuild';
import * as process from 'node:process';
import {sassPlugin} from 'esbuild-sass-plugin';
const ctx = await esbuild.context({
bundle: true,
entryPoints: ['./src/main.js'],
legalComments: 'external',
loader: {
'.png': 'dataurl',
'.svg': 'dataurl' },
minify: true,
outfile: './public_html/transmission-app.js',
plugins: [sassPlugin()],
sourcemap: true,
});
if (process.env.DEV) {
await ctx.watch();
console.log('watching...');
} else {
await ctx.rebuild();
ctx.dispose();
}