rentgen/esbuild.config.js

29 lines
767 B
JavaScript
Raw Normal View History

import esbuild from 'esbuild';
import scss from 'esbuild-plugin-sass';
import svg from 'esbuild-plugin-svgr';
2022-01-28 11:33:44 +01:00
const watch = process.argv.includes('--watch') && {
onRebuild(error) {
if (error) console.error('[watch] build failed', error);
else console.log('[watch] build finished');
},
};
esbuild
.build({
entryPoints: [
'sidebar/sidebar.tsx',
'test.ts',
'report-window/report-window.tsx',
'background.ts',
],
bundle: true,
2022-01-28 11:33:44 +01:00
minify: true,
outdir: './lib',
2022-01-20 19:03:03 +01:00
loader: { '.woff': 'file', '.woff2': 'file' },
plugins: [scss(), svg()],
2022-01-28 11:33:44 +01:00
watch,
})
2022-01-28 11:33:44 +01:00
.then(() => console.log('Add-on was built'))
.catch(() => process.exit(1));