UNPKG

fusox

Version:

Command line wrapper for fuse-box

128 lines (116 loc) 8.08 kB
const {getVersion} = require('../helpers') module.exports = {helpCommand} function helpCommand () { console.log(` Usage: fusox <source> <destination> --options Version: v${getVersion()} Notes: - PostCSS and TailwindCSS are transparently available inside all supported css dialects - You can override several config files by placing them either inside your current working directory or inside the parent directory of your source - tsconfig.json Custom typescript configuration - postcss.js Custom postcss configuration - tailwind.js Custom tailwindcss configuration Arguments: <source> Path to source files directory <destination> Path to build directory Options: -v, --version Show cli version -h, --help Show help text -d, --docs Open documentation in browser -e, --examples Open examples in browser -i, --init Scaffold project for various targets inside current directory, target defaults to "browser", see "--target" for available targets, destination defaults to current directory, you can specify different destination directory like this: "fusox --init browser demo" -t, --trace Dump long stacktrace in case an error occurs, defaults to "false" --port Set dev server port, default is "9999" --target Set build target either to "browser", "server", "electron" or "library" --browser Set build target to "browser", same as "--target=browser" --server Set build target to "server", same as "--target=server" --electron Set build target to "electron", same as "--target=electron" --library Set build target to "library", same as "--target=library" --mode Set build mode either to "development" or "production", --development Set mode to "development", same as "--mode=development" --production Set mode to "production", same as "--mode=production" --sourcemaps Generate sourcemaps, enabled in "development" mode by default --cache Use cache to speed up build, enabled in "development" mode by default --watch Watch for changes and rebuild --env Parse ".env" files in cwd and source directories in this order, ".env.dist", ".env" and ".env.(development|production)", enabled by default --cwd Override current working directory, defaults to "process.cwd()" --clean Delete previous build and cache Options for --browser | --target="browser": --run Run dev server and watch files for changes --main Set main file for your application, defaults to "index.ts" or "index.tsx" --index Set index.html file template, use $css and $bundles placeholders for injection, defaults to "index.html" --open Open web page in browser after build --uglify Uglify code in "production" mode, enabled by default --hash Hash generated files names, enabled in "production" mode by default --name Publish --main entry point under a package name on the window --cors Launch a CORS proxy server, all ajax and fetch requests will be routed trough cors proxy server, works only in "development" mode --assets List of file extensions that should be processed as assets, defaults to "jpg,png,gif,svg,txt,html", you can either override this values or append new ones by putting a "+" at the beginning --dynamic List of file extensions that are imported dynamically in your code and should always be included into your bundle, since you never know which files you may need, defaults to "json,yml,txt", you can either override this values or append new ones by putting a "+" at the beginning Options for --electron | --target="electron": --run Run dev server and watch files for changes --main Set main file for your application, defaults to "index.ts" --index Set index.html file template, use $css and $bundles placeholders for injection, defaults to "index.html" --renderer Set renderer file for your application, defaults to "renderer.ts" or "renderer.tsx" --open Open application exposed trough a web server, useful for testing hybrid apps --uglify Uglify code in "production" mode, enabled by default --hash Hash generated files names --name Publish --renderer entry point under a package name on the window --cors Launch a CORS proxy server, all ajax and fetch requests will be routed trough cors proxy server, works only in "development" mode --assets List of file extensions that should be processed as assets, defaults to "jpg,png,gif,svg,txt,html", you can either override this values or append new ones by putting a "+" at the beginning --dynamic List of file extensions that are imported dynamically in your code and should always be included into your bundle, since you never know which files you may need, defaults to "json,yml,txt", you can either override this values or append new ones by putting a "+" at the beginning Options for --server | --target="server": --run Run dev server and watch files for changes --main Set main file for your application, defaults to "index.ts" --uglify Uglify code in "production" mode, enabled by default --hash Hash generated files names --assets List of file extensions that should be processed as assets, defaults to "jpg,png,gif,svg,txt,html", you can either override this values or append new ones by putting a "+" at the beginning --dynamic List of file extensions that are imported dynamically in your code and should always be included into your bundle, since you never know which files you may need, defaults to "json,yml,txt", you can either override this values or append new ones by putting a "+" at the beginning Options for --library | --target="library": --main Set main file for your library, defaults to "index.ts" --module Set module format that you want to achieve, either "esm", "cjs" or "web" You can provide either a single module format or a comma separated list of formats Different module formats are meant for use in different situations: - "esm" is useful when used together with other esm modules that are processed by a bundler like rollup, webpack or fusox, contains no dependencies, needs to be transpiled at some point - "cjs" can be used directly within any nodejs applicaton, dependencies are not bundled and will be resolved trough node's require(...) function - "web" is a bundle that can be used inside the browser, all the necessary dependencies are also bundled --esm Set module format to "esm", same as --module=esm, no bundling --cjs Set module format to "cjs", same as --module=cjs, no bundling --web Set module format to "web", same as --module=web, generates a bundle --all Set module format to "esm", "cjs", "web", same as --module=esm,cjs,web --uglify Uglify "web" bundle in "production" mode, enabled by default --name Publish --main entry point under a package name on the window, for "web" module `) }