From 5248362ae7a47527adbd49638bae17e086f6f28c Mon Sep 17 00:00:00 2001 From: Benjamin de Oostfrees <68224180+deoostfrees@users.noreply.github.com> Date: Thu, 20 Jan 2022 13:51:20 +0100 Subject: [PATCH] Add rollup --- rollup.config.js | 77 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 rollup.config.js diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..9b1fd6b --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,77 @@ +import resolve from '@rollup/plugin-node-resolve' +import commonjs from '@rollup/plugin-commonjs' +import postcss from 'rollup-plugin-postcss' +import license from 'rollup-plugin-license' + +const pkg = require('./package.json') + +const bannerContent = ` + Gibki + + @author ${pkg.author} + @version ${pkg.version} + @url ${pkg.homepage} + + ${pkg.license} license` + +let rollupBuilds + +/** + * Build CSS + * + */ +if (process.env.BUILD) { + rollupBuilds = [{ + input: './scss/gibki.scss', + output: [ + { + file: './css/gibki.css' + } + ], + plugins: [ + resolve({ + browser: true + }), + commonjs(), + postcss({ + extract: true + }), + license({ + banner: { + content: bannerContent + } + }) + ], + watch: { + clearScreen: false + } + }, + { + input: './scss/gibki.scss', + output: [ + { + file: './css/gibki.min.css' + } + ], + plugins: [ + resolve({ + browser: true + }), + commonjs(), + postcss({ + extract: true, + minimize: true + }), + license({ + banner: { + content: bannerContent + } + }) + ], + watch: { + clearScreen: false + } + }] +} + +export default rollupBuilds