2020-11-11 00:00:54 +01:00
|
|
|
import svelte from 'rollup-plugin-svelte';
|
2023-09-14 12:29:06 +02:00
|
|
|
import resolve, { nodeResolve } from '@rollup/plugin-node-resolve';
|
2020-11-11 00:00:54 +01:00
|
|
|
import commonjs from '@rollup/plugin-commonjs';
|
|
|
|
import livereload from 'rollup-plugin-livereload';
|
2023-09-14 12:29:06 +02:00
|
|
|
import terser from '@rollup/plugin-terser';
|
2023-09-19 14:35:35 +02:00
|
|
|
import babel from '@rollup/plugin-babel'
|
2020-11-11 00:00:54 +01:00
|
|
|
|
|
|
|
const production = !process.env.ROLLUP_WATCH;
|
|
|
|
|
|
|
|
const builddir = "../res/static/svelte"
|
|
|
|
export default [
|
2021-05-18 23:47:38 +02:00
|
|
|
"file_viewer",
|
2020-11-11 00:00:54 +01:00
|
|
|
"filesystem",
|
2021-09-21 21:39:28 +02:00
|
|
|
"user_home",
|
2021-05-18 23:47:38 +02:00
|
|
|
"user_file_manager",
|
2021-05-25 22:15:29 +02:00
|
|
|
"admin_panel",
|
2021-06-22 17:14:21 +02:00
|
|
|
"home_page",
|
2022-02-21 23:25:44 +01:00
|
|
|
"text_upload",
|
2020-11-11 00:00:54 +01:00
|
|
|
].map((name, index) => ({
|
|
|
|
input: `src/${name}.js`,
|
|
|
|
output: {
|
|
|
|
sourcemap: true,
|
|
|
|
format: 'iife',
|
|
|
|
name: 'app',
|
2023-09-14 12:29:06 +02:00
|
|
|
file: `${builddir}/${name}.js`,
|
2020-11-11 00:00:54 +01:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
svelte({
|
2023-09-14 12:29:06 +02:00
|
|
|
compilerOptions: {
|
|
|
|
// enable run-time checks when not in production
|
|
|
|
dev: !production,
|
|
|
|
// we'll extract any component CSS out into
|
|
|
|
// a separate file - better for performance
|
|
|
|
// css: css => {
|
|
|
|
// css.write(`${name}.css`);
|
|
|
|
// },
|
|
|
|
},
|
|
|
|
emitCss: false,
|
2020-11-11 00:00:54 +01:00
|
|
|
}),
|
|
|
|
|
2023-09-19 14:35:35 +02:00
|
|
|
babel({
|
|
|
|
extensions: [".js", ".html", ".svelte"],
|
|
|
|
babelHelpers: "bundled",
|
|
|
|
}),
|
|
|
|
|
2020-11-11 00:00:54 +01:00
|
|
|
// 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,
|
2023-09-14 12:29:06 +02:00
|
|
|
exportConditions: ['svelte'],
|
|
|
|
extensions: ['.svelte'],
|
2020-11-11 00:00:54 +01:00
|
|
|
}),
|
|
|
|
commonjs(),
|
2023-09-14 12:29:06 +02:00
|
|
|
nodeResolve(),
|
2020-11-11 00:00:54 +01:00
|
|
|
|
|
|
|
// In dev mode, call `npm run start` once
|
|
|
|
// the bundle has been generated
|
|
|
|
// !production && serve(),
|
|
|
|
|
|
|
|
// Watch the `public` directory and refresh the
|
|
|
|
// browser on changes when not in production
|
|
|
|
!production && livereload({
|
|
|
|
watch: `${builddir}/${name}.*`,
|
|
|
|
port: 5000 + index,
|
|
|
|
}),
|
|
|
|
|
|
|
|
// If we're building for production (npm run build
|
|
|
|
// instead of npm run dev), minify
|
2023-09-18 22:43:12 +02:00
|
|
|
production && terser(),
|
2020-11-11 00:00:54 +01:00
|
|
|
],
|
|
|
|
watch: {
|
|
|
|
clearScreen: false
|
2023-09-14 12:29:06 +02:00
|
|
|
},
|
2020-11-11 00:00:54 +01:00
|
|
|
}));
|