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

Allow the use of a pundle config file. #63

Closed
AriaFallah opened this issue Jul 30, 2016 · 3 comments
Closed

Allow the use of a pundle config file. #63

AriaFallah opened this issue Jul 30, 2016 · 3 comments

Comments

@AriaFallah
Copy link

AriaFallah commented Jul 30, 2016

Right now, although powerful, having to manually go through the boilerplate steps of calling pundle.compile, pundle.generate, and fs.writeFileSync all in different promise blocks is a hassle. I know it's not that big of a deal, but I feel like since every other alternative offers a config file, the programmatic approach can scare newcomers away.

pundle-dev kinda solves this problem with it's server config, but that doesn't work with just pundle by itself.

It'd be nice to have something like:

export default {
  entry: ['index.js'],
  rootDirectory: './src',
  pathType: 'filePath',
  moduleDirectories: ['node_modules'],
  plugins: [
    ['babel-pundle', { config: { presets: ['steelbrain'] } }],
    'pundle-some-magical-plugin'
  ],
  loaders: [
    { extensions: ['.coffee'], loader: 'pundle-coffee' },
    { extensions: ['.less'], loader: 'pundle-less' }
  ],
  sourceMap: true,
  outputDirectory: 'lib'
}

The API for the config file would probably be different than this, but you get the idea. You could also add a server block if you instead to use this config with a server. It also carries the benefit of being more readable.

@steelbrain
Copy link
Owner

I love the idea!

@steelbrain
Copy link
Owner

This has been implemented in #75
I'll keep this open until it's merged

@steelbrain
Copy link
Owner

Fixed in Pundle v2Alpha1

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

No branches or pull requests

2 participants