Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import svelte from "rollup-plugin-svelte";
- import resolve from "rollup-plugin-node-resolve";
- import commonjs from "rollup-plugin-commonjs";
- import scss from "rollup-plugin-scss";
- import livereload from "rollup-plugin-livereload";
- import { autoPreprocess } from "svelte-preprocess/dist/autoProcess";
- import { terser } from "rollup-plugin-terser";
- import del from "rollup-plugin-delete";
- const production = !process.env.ROLLUP_WATCH;
- const port = process.env.PORT;
- const buildDir = "public/dist";
- export default {
- input: "src/index.js",
- output: {
- name: "app",
- format: "esm",
- sourcemap: !production,
- dir: `${buildDir}`,
- },
- manualChunks(id) {
- if (id.includes("node_modules")) {
- return "vendor";
- }
- },
- plugins: [
- del({
- targets: "public/dist/*",
- runOnce: true,
- }),
- svelte({
- dev: !production,
- emitCss: true,
- preprocess: autoPreprocess({ postcss: true }),
- }),
- scss({ output: `${buildDir}/bundle.css` }),
- resolve({
- browser: true,
- dedupe: ["svelte"],
- }),
- commonjs(),
- !production &&
- livereload({
- watch: "public",
- }),
- production && terser(),
- ],
- watch: {
- clearScreen: false,
- },
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement