@@ -36,6 +36,8 @@ var USAGE = `
3636 Compile all files in the project to disk
3737 ${ clr ( '$ bankai build index.js' , 'cyan' ) }
3838
39+ For configuration usage, type 'bankai --help config'
40+
3941 Running into trouble? Feel free to file an issue:
4042 ${ clr ( 'https://github.com/choojs/bankai/issues/new' , 'cyan' ) }
4143
@@ -53,6 +55,49 @@ var NOCOMMAND = `
5355 Run ${ clr ( 'bankai --help' , 'cyan' ) } to see all options.
5456` . replace ( / \n $ / , '' ) . replace ( / ^ \n / , '' )
5557
58+ var CONFIG_USAGE = `
59+
60+ ${ clr ( 'Configuration' , 'bold' ) }
61+
62+
63+ Bankai is built on top of compilers for scripts, styles and documents.
64+ Each of them can be configured by adding a field to your project's
65+ package.json file.
66+
67+ These three fields are, respectively: ${ clr ( '"browserify"' , 'cyan' ) } , ${ clr ( '"sheetify"' , 'cyan' ) } and
68+ ${ clr ( '"documentify"' , 'cyan' ) } . Each one should have a configuration object as it's value.
69+
70+ There is currently one possible configuration field: "transform".
71+
72+ It can be one of either:
73+
74+ 1. An array of transform names.
75+ ie: ${ clr ( '[ "vueify" ]' , 'cyan' ) }
76+ 2. An array of tuples transform name + configuration object.
77+ ie: ${ clr ( '[[ "vueify", { "sass": { "includePaths": [ "src/assets/css" ] } } ]]' , 'cyan' ) }
78+
79+
80+ Full example:
81+
82+ ${ clr ( `{
83+ "browserify": {
84+ "transform": [
85+ [ "vueify", { "sass": { "includePaths": [ "src/assets/css" ] } } ]
86+ ]
87+ },
88+ "sheetify": {
89+ "transform": [
90+ "sheetify-cssnext"
91+ ]
92+ },
93+ "documentify": {
94+ "transform": [
95+ [ "posthtmlify", { "use": [ "posthtml-custom-elements" ] } ]
96+ ]
97+ }
98+ }` , 'cyan' ) }
99+ ` . replace ( / \n $ / , '' ) . replace ( / ^ \n / , '' )
100+
56101var argv = minimist ( process . argv . slice ( 2 ) , {
57102 alias : {
58103 help : 'h' ,
@@ -78,6 +123,7 @@ var argv = minimist(process.argv.slice(2), {
78123 }
79124
80125 if ( argv . help ) {
126+ if ( cmd === 'config' ) return console . log ( CONFIG_USAGE )
81127 console . log ( USAGE )
82128 } else if ( argv . version ) {
83129 console . log ( require ( './package.json' ) . version )
0 commit comments