I am trying to bundle my js and scss files in rollup ready for production. Rollup takes all of my files and outputs them to a build dir, the result looks like this:
build
css
bundle.css
js
bundle.js
bundle.js.gz
As you can see, I am using the gzipPlugin for my js files.
I also want to use gzipPlugin to handle my css, but I cannot figure out how to do this.
My current setup looks like this:
import babel from "rollup-plugin-babel";
import { terser } from "rollup-plugin-terser";
import multi from "@rollup/plugin-multi-entry";
import gzipPlugin from "rollup-plugin-gzip"
import scss from "rollup-plugin-scss"
import del from "rollup-plugin-delete"
export default [{
input: "src/**/*.logic.js",
output: {
file: "build/assets/js/main.min.js",
format: "umd",
name: "Logic"
},
plugins: [
del({ targets: "build" }),
gzipPlugin(),
terser({
output: {
wrap_iife: false
}
}),
multi({
exports: true
}),
babel({
exclude: "node_modules/**"
})
]
}, {
input: "src/all.scss",
plugins: [
scss({
output: "build/assets/css/styles.min.css",
outputStyle: "compressed"
}),
]
}
];
My question is: How can I get my outputted css file to be gzipped?.
I think I am missing something fairly simply, I just can't see how to get gzipPlugin working on the css file.... thanks in advance for any tips.