rollup.config.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // import { resolve } from "path";
  2. import svelte from "rollup-plugin-svelte";
  3. import externals from "rollup-plugin-node-externals";
  4. import css from "rollup-plugin-css-only";
  5. import sveltePreprocess from "svelte-preprocess";
  6. // import alias from '@rollup/plugin-alias';
  7. import typescript from '@rollup/plugin-typescript';
  8. import { VERSION } from "./src/version";
  9. import commonjs from "@rollup/plugin-commonjs";
  10. const production = !process.env.ROLLUP_WATCH
  11. export default [
  12. {
  13. input: [
  14. "src/repo_worker.ts",
  15. "src/rollup_worker.ts",
  16. "src/preload.ts",
  17. "src/main.ts",
  18. "src/index.ts",
  19. "src/stores.ts",
  20. ],
  21. output: [
  22. {
  23. sourcemap: !VERSION.production,
  24. dir: "build",
  25. format: "cjs",
  26. },
  27. ],
  28. plugins: [
  29. typescript({ sourceMap: !production }),
  30. svelte({
  31. preprocess: [
  32. sveltePreprocess({ sourceMap: !production, }),
  33. ],
  34. }),
  35. externals({ deps: true }),
  36. css({ output: "bundle.css" }),
  37. commonjs({include: ["/Users/zorro/entwicklung/SVWS-Server/svws-ts-lib/src/main/ts/"]})
  38. // alias({
  39. // entries: [
  40. // { find: '@svws-nrw/svws-ts-lib', replacement: resolve(__dirname, "../SVWS-Server/svws-ts-lib/src/main/ts") },
  41. // ]
  42. // })
  43. ],
  44. onwarn(warning, warn) {
  45. if (warning.code === "CIRCULAR_DEPENDENCY") return;
  46. warn(warning);
  47. },
  48. },
  49. ];