This module holds all web resources that make the client application of spring.io:
- JavaScript modules
- CSS styles
- images and fonts
- front-end dependencies
This module is using several tools for its own build system:
Node.js is brought by the Gradle build itself, so you don't need it to build the project.
But if you want to work on the sagan-client
module, installing a recent version of node.js
is a good idea. Usage of the Node Version Manager (nvm) is perfectly fine.
When running the application with the SiteApplication
class in your IDE, resources in sagan-client are served
directly from resources built in the sagan-client module, so you can keep the Java application running
and re-build the client by running npm run build
on the command line.
For this to work, your IDE should be configured to consider the sagan-site
module as its working directory. Check out
the run the site locally section on the wiki.
If you want to know more about the JavaScript build, this chapter will help you; reading this is not required.
The JavaScript application can be built manually with (the build result is located in the build/dist
folder):
$ npm run build
This will trigger the webpack build, which bundles and optimizes the JavaScript, CSS and images.
Check the webpack.config.js
file for more details.
npm is the node package manager; it installs required dependencies in the node_modules
directory.
Check the package.json
file to find:
- all dependencies and their versions in
devDependencies
- all available
scripts
that you can run withnpm run scriptname
Note: we make extensive use of npm scripts so you don't have to install binaries globally on your system's PATH.
npm dynamically adds binaries listed in node_modules/.bin
to its own PATH.