React Data GridCustom builds
Handsontable's building process transforms the source files located in the code repository into dedicated packages.
Overview
Monorepo
The Handsontable repository is a monorepo that contains the following projects:
Project | Location | Description |
---|---|---|
handsontable | /handsontable | Main Handsontable project |
@handsontable/react | /wrappers/react | React wrapper |
@handsontable/react-wrapper | /wrappers/react-wrapper | React wrapper (functional components) |
@handsontable/angular | /wrappers/angular | Angular wrapper |
@handsontable/vue | /wrappers/vue | Vue 2 wrapper |
@handsontable/vue3 | /wrappers/vue3 | Vue 3 wrapper |
All the projects are released together, under the same version number. But each project has its own building and testing processes.
Build processes
The building processes transform the source files located in the /handsontable/src/
directory into the following output files:
/handsontable/dist/
- handsontable UMD files, including minified versions
- classic theme CSS files, including minified versions
- the language files
/handsontable/styles/
- modern theme CSS files, including minified versions
handsontable/tmp/
- ESM, CommonJS and UMD builds, type definition files etc.
TIP
Don't modify the output files mentioned above. Instead, make changes in the /handsontable/src/
directory and then run a selected build. This is especially important if you want to contribute your changes back to Handsontable through a pull request.
For more information on the distribution packages, see this file (opens new window).
Build requirements
Handsontable building processes require:
- Node.js (opens new window) (version defined in
.nvmrc
in the root of the repository) - npm (opens new window) (version corresponding to the Node.js version)
- Node modules installed through
npm install
(e.g. webpack (opens new window) and Babel (opens new window))
package.json
files
Each Handsontable project has its own building processes defined in its own package.json
file. Apart from that, the root directory has its own package.json
file as well:
File | Holds tasks for building: |
---|---|
/package.json | - All the packages at once - Individual packages |
/handsontable/package.json | The JavaScript package |
/wrappers/react/package.json | The React package |
/wrappers/react-wrapper/package.json | The React (functional) package |
/wrappers/angular/package.json | The Angular package |
/wrappers/vue/package.json | The Vue 2 package |
/wrappers/vue3/package.json | The Vue 3 package |
Run your first build
To run your first build:
- Install Node.js (opens new window).
- Install npm (opens new window).
- Clone the Handsontable repository (opens new window).
- From the root directory, run
npm install
.
All the required dependencies get installed. - From the root directory, run
npm run build
.
All the Handsontable packages get built.
Build the packages
You can either build all the packages at once, or build each package individually.
Build all the packages
To build all the packages at once:
- Make sure you meet the build requirements.
- Go to the root directory.
- Run
npm run build
.
The script builds the following packages:- The JavaScript package
- The React package
- The React (functional) package
- The Angular package
- The Vue 2 package
- The Vue 3 package
- A code examples package
- Visual-tests package
Build the JavaScript package
To build the JavaScript package:
- Make sure you meet the build requirements.
- Go to
/handsontable
. - Run
npm run build
.
Only the JavaScript package builds.
To build the JavaScript package from the root directory:
- Make sure you meet the build requirements.
- Go to the root directory.
- Run
npm run in handsontable build
.
Only the JavaScript package builds.
JavaScript build tasks
From the /handsontable
directory, you can also run individual JavaScript build
tasks:
JavaScript build tasks
npm run build:commonjs
- Transpiles the files into the CommonJS format.
npm run build:es
- Transpiles the files into the ESM format.
npm run build:umd
- Creates the following bundles compatible with the Universal Module Definition:
/handsontable/dist/handsontable.js
/handsontable/dist/handsontable.css
/handsontable/dist/handsontable.full.js
/handsontable/dist/handsontable.full.css
/handsontable/styles/*
- non-minified theme CSS files
npm run build:umd.min
- Creates the minified bundles compatible with the Universal Module Definition:
/handsontable/dist/handsontable.min.js
/handsontable/dist/handsontable.min.css
/handsontable/dist/handsontable.min.full.js
/handsontable/dist/handsontable.min.full.css
/handsontable/styles/*
- minified theme CSS files
npm run build:walkontable
- Builds Walkontable, an essential part of Handsontable that's responsible for the rendering process.
npm run build:languages
- Creates the language bundles compatible with the Universal Module Definition, for example:
/handsontable/dist/languages/de-DE.js
/handsontable/dist/languages/all.js
build:languages.es
- Creates the language bundles compatible with the ESM format, for example:
languages/en-US.mjs
npm run build:languages.min
- Creates the minified language bundles compatible with the Universal Module Definition, for example:
/handsontable/dist/languages/de-DE.min.js
/handsontable/dist/languages/all.min.js
Build the React package
To build the React package:
- Make sure you meet the build requirements.
- Go to either
/wrappers/react
or/wrappers/react-wrapper
, depending on the React package you'd like to build. - Run
npm run build
.
Only the React package builds.
To build the React package from the root directory:
- Make sure you meet the build requirements.
- Go to the root directory.
- Run
npm run in react build
/npm run in react-wrapper build
.
Only the React package builds.
React build tasks
From the React wrapper directory, you can also run individual React build
tasks:
React build tasks
npm run build:commonjs
- Transpiles the files into the CommonJS format.
- Places the output in
/commonjs/react-handsontable.js
npm run build:umd
- Creates the following bundles compatible with the Universal Module Definition:
/dist/react-handsontable.js
/dist/react-handsontable.js.map
npm run build:es
- Transpiles the files into the ESM format.
- Places the output in
/es/react-handsontable.mjs
npm run build:min
- Creates the minified bundles:
/dist/react-handsontable.min.js
/dist/react-handsontable.min.js.map