Closed scottcorgan closed 8 years ago
I have seen some pretty long npm scripts too, and it tends to get a bit out of hand. I'm a bit hesitant to add .budorc
or some other config (like in package.json
) since it adds another layer of complexity for those not familiar with budo, and also pushes the config away from the command itself (so it isn't immediately clear what flags are set). I am trying my best to avoid turning budo into another behemoth like webpack or babel.
A couple other ways of keeping things small and DRY:
"browserify": { "transform": "babelify" }
in package.json. This field doesn't support plugins, and isn't useful if you need different dev/prod transforms. It's also no good if you are building a module/lib, instead of an app.dev.sh
or dev.js
file. For example:#!/usr/bin/env node
// in `tasks/dev.js`
require('budo').cli(process.argv.slice(2), {
pushstate: true,
port: 3000,
live: true,
title: 'Foo',
debug: false,
serve: 'bundle.js',
onupdate: 'npm run lint',
css: 'dist/index.css',
browserify: {
transform: [ 'babelify' ],
plugin: [ ... ]
}
});
And then:
"scripts": {
"start": "./tasks/dev.js src/index.js"
}
I'm open to more ideas / discussion, though. :smile:
Fair enough. Probably a good idea to keep it focused. I'll write a script or a wrapper around budo for this feature. Thanks for the consideration!
I was curious if it has been considered to add a dot config file (like bable/eslint)? My script line gets pretty long with my options:
Thoughts?