Skip to content

Instantly share code, notes, and snippets.

@alpavlove
Created July 28, 2022 14:46
Show Gist options
  • Save alpavlove/7c6d0a933af1a42b66b9d89e5c9ced71 to your computer and use it in GitHub Desktop.
Save alpavlove/7c6d0a933af1a42b66b9d89e5c9ced71 to your computer and use it in GitHub Desktop.
Create React Components library
const postcss = require('rollup-plugin-postcss');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
module.exports = {
rollup(config, options) {
config.plugins.push(
postcss({
plugins: [
autoprefixer(),
cssnano({
preset: 'default',
}),
],
inject: false,
// only write out CSS for the first bundle (avoids pointless extra files):
extract: !!options.writeMeta,
})
);
return config;
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment