Repo template to "require" the fin-hypergrid npm module and build a single .js file using gulp-browserify.
git clone https://github.com/openfin/fin-hypergrid-browserify-template.git my-proj
cd my-proj
npm install
gulp
open index.html
The above series of commands downloads, builds, and runs the demo:
git clone ...
- downloads the demo
cd ...
- change to the new directory
npm install
- install dev dependencies (such as Browserify) used by gulp below to create the build
- install external dependencies, only
fin-hypergrid
for this template, but you can add more as needed
gulp
- creates the
./build
directory (if not already there) - runs Browserify to create a single bundled file,
./build/index.js
, from:- your
./index.js
; and - the
fin-hypergrid
package, etc.
- your
- creates the
open index.html
runs the demo page- uses the
file://
protocol (no server needed) - requests the bundled file (
build/index.js
) via a<script>
tag - note that
open
is only available on macOS; on other systems manually open the file in a browser
- uses the
To test your build with the alpha version of fin-hypergrid instead of the current version of the npm module,
change the fin-hypergrid
dependency in the package.json file to
"https://github.com/openfin/fin-hypergrid#alpha"
and then rebuild:
npm update
gulp
open index.html
To test a local fork of Hypergrid instead of the current version,
change the fin-hypergrid
dependency in the package.json file to
file:../fin-hypergrid
or simply "../fin-hypergrid"
(assuming your fork is in a sister folder) and rebuild as above.
For actual development iterations, we suggest enhancing the build file with a watcher (to rebuild and reload), linter, and minifier. See for example fin-hypergrid/core/gulpfile.js.