Getting Started
Quickly get setup to work with Knot.
Starting a New Project
If you will be starting a new knot project, the best option would be to use the provided project generator. It currently supports projects which use react, vue,webpack, browserify and rollup. In order to run the command either install it globally or use it directly with npx.
npm install --global @knot/cli
# or
yarn global add @knot/cliTo start a new project, create a directory for it and run the generator's init command. You will be prompted to choose a type of project as well as answer a couple of questions.
knot init
# or, to skip installation
npx knot initThis command will generate a number of files, most important being the following:
.knot.yml- configuration file for theknotcompilersrc/index.js- the javascript entry pointsrc/index.kn- theknotapplication entry point
A development server can be started by running the package's start command:
npm start
# or
yarn startThe code can also be bundled by webpack into minified javascript and html:
npm build
# or
yarn buildLast updated
Was this helpful?