silverstripe-userforms/docs/en/compiling-front-end-files.md

24 lines
805 B
Markdown
Raw Normal View History

# Compiling front-end files
2015-08-21 01:04:22 +02:00
UserForms stylesheets are written in SASS and JavaScript follows ES6 syntax. Both are compiled with Webpack into distributable, minified files.
2015-08-21 01:04:22 +02:00
To get started, you will first need NodeJS, NPM, Webpack and Yarn installed. For more information on this process, [see "Build Tooling" in the SilverStripe documentation](https://docs.silverstripe.org/en/4/contributing/build_tooling/).
2015-08-21 01:04:22 +02:00
## Watching for changes
2015-08-21 01:04:22 +02:00
As you make changes to SASS or JavaScript, you can ask Yarn to watch and rebuild the deltas as their are saved:
2015-08-21 01:04:22 +02:00
```sh
yarn watch
2015-08-21 01:04:22 +02:00
```
This will not minify the dist files.
## Compile assets for production
2015-08-21 01:04:22 +02:00
When you're happy with your changes and are ready to make a pull request you should run a "build" command to compile and minify everything:
2015-08-21 01:04:22 +02:00
```sh
yarn build
2015-08-21 01:04:22 +02:00
```