This module uses webpack to build JS and CSS files. This is in line with how the SilverStripe core-modules build their client-assets.
We use SASS to write CSS. The build-tools include an auto-prefixer that will add browser-prefixes if needed.
JavaScript should be written as ES6.
Plain JavaScript file should use the .js
extension, while React components use .jsx
.
The files will be transpiled to a single (browser consumable) JavaScript file using webpack and babel.
First of all, you need to install the yarn package manager on your system. Then do the following:
cd ./vendor/jonom/focuspoint
yarn
This will install all the npm dependencies in node_modules
During development, you can use the following command to create a development build:
yarn run dev
There's also a "watch" command that will watch your files and build new JS and CSS every time you change a file:
yarn run watch
To create a release build, do:
yarn run build