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'
|
|
|
|
|
|
|
|
|
|
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',
|
2024-06-18 11:06:41 +02:00
|
|
|
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(),
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
}
|
|
|
|
|
};
|