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

Add ConfigGenerator #635

Open
Kocal opened this issue Feb 27, 2020 · 0 comments
Open

Add ConfigGenerator #635

Kocal opened this issue Feb 27, 2020 · 0 comments
Milestone

Comments

@Kocal
Copy link
Contributor

Kocal commented Feb 27, 2020

A bit related to #634

Add a config generator, aside the old plain-object config? We would have access to typings and a easier usage.

const { ConfigGenerator } = require('@yproximite/yprox-cli');

const configGenerator = ConfigGenerator.init()
  .configureAssets('app', (asset) => {
    asset.addRollupEntry('src/yprox-cli.config.js/my-file.js', rollupOptions => {});
    asset.copyFiles(from, to);
    asset.optimizeImages(from, to);
    asset.addSassEntry(...); 
    // ...
  })
  .configureRollup(options => {
     // ...
   })
;

module.exports = configGenerator.generate()

Methods to implement:

  • .addEntry(name, ['...'], {})
  • .addStyleEntry(name, ['...'], {}),
  • .copyFiles(from, to)
  • .optimizeImages(from, to)
  • .configureRollup(rollup => { })
  • .configureESLint(eslint => { })
  • .configurePostCSS(postcss, => {})
  • .configureAutoprefixer(autoprefixer => {});
  • .configureImagesOptimization(options => {});
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