Setting up Water

To set up Water in your Javascript/Typescript project, start by installing the npm package:

This package contains the compiler, which converts valid Water source code to a WebAssembly binary. It can be used directly like this:

Webpack

If you are using Webpack, a loader is included in this package for your convenience.

To use the loader, you will need to modify the Webpack configuration file in your project, typically named `webpack.common.js`, and add the following new configuration entry under the `module.exports.module.rules` array:

To clarify, the configuration should look something like this in the end:

After this is done, you will be able to import compiled versions of Water files directly into your Javascript / Typescript files:

Other loaders

Support for other loaders has not been implemented yet, but if you would like to contribute, please open an issue or pull request on Github.