Skip to content

Instantly share code, notes, and snippets.

@romanlex
Created October 1, 2018 11:07
Show Gist options
  • Save romanlex/0bcd7aa71d498c03a2bf4d5511c1e687 to your computer and use it in GitHub Desktop.
Save romanlex/0bcd7aa71d498c03a2bf4d5511c1e687 to your computer and use it in GitHub Desktop.
Rollup config
import sass from 'rollup-plugin-sass'
import webworkify from 'rollup-plugin-webworkify'
import bundleWorker from 'rollup-plugin-bundle-worker'
import autoprefixer from 'autoprefixer'
import alias from 'rollup-plugin-alias'
import babel from 'rollup-plugin-babel'
import cjs from 'rollup-plugin-commonjs'
import cssurl from 'postcss-url'
import env from 'postcss-preset-env'
import json from 'rollup-plugin-json'
import postcss from 'rollup-plugin-postcss'
import resolve from 'rollup-plugin-node-resolve'
import scss from 'rollup-plugin-scss'
const aliases = require('./aliases')
export default {
input: 'src/index.js',
cache: true,
external: ['react', 'react-dom', 'prop-types', 'classnames'],
output: {
file: 'bundle.js',
format: 'umd',
},
plugins: [
json(),
postcss({
modules: true,
extract: true,
namedExports: true,
plugins: [
cssurl({
url: 'inline',
}),
env(),
autoprefixer(),
],
}),
alias(aliases),
bundleWorker(),
babel({
exclude: 'node_modules/**',
}),
cjs(),
sass(),
resolve({
extensions: ['.scss', '.sass'],
}),
scss(),
],
}
@adelinopds
Copy link

você consegue extrair o css em um arquivo separado?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment