@compgen/cra-min
v0.1.14
Published
**Unless you are building custom CRA generator then you probably want to use: [@compgen/cra](packages/macro-generators/cra)**
Downloads
24
Readme
@compgen/cra-min
Unless you are building custom CRA generator then you probably want to use: @compgen/cra
This is a micro generator for minimal CRA configuration. This generator will remove most of the code that CRA generates.
CLI
I highly recommend using npx
so that you don't have to install anything globally, and you can always get the latest version from npm.
- optional
--path=target_folder
npx @compgen/cra-min
Programmatically
You have to generate JSON schema and use execute
function from @compgen/core
:
// src/index.ts
import { execute, getProjectFolder, askProjectName } from '@compgen/core'
import { askYesNo } from '@compgen/core'
import { createSchema } from '@compgen/cra-min'
export const askIsRouter = () => askYesNo('Do you want to use React Router?')
const generate = async () => {
const { projectFolder } = await askProjectName()
const isRouter = await askIsRouter()
const schema = createSchema({ isRouter, projectFolder })
await execute(schema, projectFolder)
}
generate()
Now all you have to do is run:
ts-node src/index.ts