alloc / build-if-changed

Run build scripts only when files changed (good with monorepos)
https://asciinema.org/a/VUAsJEJ4sa8AFpIAHnEkwMZV7
MIT License
7 stars 6 forks source link

Auto-combine rollup configs #6

Open aleclarson opened 5 years ago

aleclarson commented 5 years ago
bic rollup

The command above runs npx bic-rollup which looks for rollup.config.js in each package and combines them into a single Rollup config. Every flag supported by the rollup command is also supported by bic rollup.

It checks the .bic_cache before merging the rollup.config.js of any given package (except in watch mode).

Note: The Rollup API probably has a nice way to load rollup.config.* modules, so TypeScript can be supported (eg: rollup.config.ts).

aleclarson commented 5 years ago
if (hasChanged(pkg.root)) {
  const pkgConfig = toArray(
    rollup.loadConfig(pkg.root) // (probably not a real method)
  )
  rootConfig.push(...pkgConfig.map(config => {
    // TODO: Normalize input/output paths
  }))
}