Created
July 28, 2022 14:46
-
-
Save alpavlove/7c6d0a933af1a42b66b9d89e5c9ced71 to your computer and use it in GitHub Desktop.
Create React Components library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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