Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to designate input and output. #125

Open
rbiggs opened this issue Sep 22, 2018 · 0 comments
Open

No way to designate input and output. #125

rbiggs opened this issue Sep 22, 2018 · 0 comments

Comments

@rbiggs
Copy link

rbiggs commented Sep 22, 2018

I have a package.json script that runs normal PostCSS:

"css": "postcss dev/css/styles.css --output css/styles.css"

I also watch certain files and reload the browser when there are changes. Before reloading I use Rollup to process any changes, such as repocessing the JavaScript, etc. I'm watch the CSS in the dev folder from above and would like to use this plugin to regenerate it just like the package.json script. However you don't have any documentation for input/output, from/to. Here's the script I have for PostCSS:

const bs = require("browser-sync").create();
const rollup = require("rollup")
const css = require('rollup-plugin-postcss')

bs.watch("dev/css/*.css").on("change",() => {
  rollup.rollup({
    input: './dev/css/styles.css',
    plugins: [
      css({
        output: './css/styles.css'
      })
    ]
  })
})

P.S. I'm only using PostCSS to minify and move the CSS, nothing fancy. I would have used cssnano, which I used before, but there's no Rollup plugin for that and PostCSS uses it for minification anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant