mirror of
https://github.com/transmission/transmission
synced 2024-12-23 08:13:27 +00:00
24 lines
541 B
JavaScript
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();
|
|
}
|