rentgen/esbuild.config.js

29 wiersze
770 B
JavaScript
Czysty Zwykły widok Historia

import esbuild from 'esbuild';
import scss from 'esbuild-plugin-sass';
import svg from 'esbuild-plugin-svgr';
2022-01-28 10:33:44 +00: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-29 17:20:26 +00:00
// minify: true,
outdir: './lib',
2022-01-20 18:03:03 +00:00
loader: { '.woff': 'file', '.woff2': 'file' },
plugins: [scss(), svg()],
2022-01-28 10:33:44 +00:00
watch,
})
2022-01-28 10:33:44 +00:00
.then(() => console.log('Add-on was built'))
.catch(() => process.exit(1));