odfjs/rollup.config.js

50 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

2024-06-14 16:57:20 +02:00
import svelte from 'rollup-plugin-svelte';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import terser from '@rollup/plugin-terser';
import css from 'rollup-plugin-css-only';
import sveltePreprocess from 'svelte-preprocess'
import { visualizer } from "rollup-plugin-visualizer";
2024-06-14 16:57:20 +02:00
const production = !process.env.ROLLUP_WATCH;
export default {
2024-06-15 12:54:53 +02:00
input: 'scripts/front-end.js',
2024-06-14 16:57:20 +02:00
output: {
sourcemap: true,
format: 'es',
dir: 'build'
2024-06-14 16:57:20 +02:00
},
plugins: [
svelte({
compilerOptions: {
// enable run-time checks when not in production
dev: !production,
},
preprocess: sveltePreprocess()
}),
css({ output: 'bundle.css' }),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration -
// consult the documentation for details:
// https://github.com/rollup/plugins/tree/master/packages/commonjs
resolve({
browser: true,
dedupe: ['svelte']
}),
commonjs(),
visualizer(),
2024-06-14 16:57:20 +02:00
// If we're building for production (npm run build
// instead of npm run dev), minify
2024-06-15 16:29:16 +02:00
//production && terser()
2024-06-14 16:57:20 +02:00
],
watch: {
clearScreen: false
}
};