1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 00:04:06 +00:00
transmission/web/esbuild.mjs

25 lines
541 B
JavaScript
Raw Normal View History

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();
}