1484226097 by Unknown
Author:Unknown
Language: eng
Format: epub
Published: 2018-08-16T14:08:57+00:00
Chapter 4 tooling and libraries
Building
When we develop an Elm application we want to automate as much as possible, as follows:
• Compile changed files automatically.
• Build distribution files.
• Invoke tools easily.
• Run a web server with the compiled files.
• Support JavaScript frameworks and CSS creation.
Luckily, we can use the same tools the JavaScript web community has created. Apart from Webpack2 mentioned in the previous section, we also have Gulp3 and Grunt4 available.
All the previously mentioned tools require configurations and use many other Node packages to do their jobs. If you just want to watch Elm files and compile them when they have changed, a more lightweight solution would be Chokidar5 or Chokidar-cli.6 The following script (Listing 4-11) can be integrated into the scripts section in package.json.
Listing 4-11.
"watch": "chokidar '**/*.elm' -c 'elm make allbasics.elm
--output elm.js --warn' --initial"
Whenever a file changes, the main file allbasics.elm and dependent files will be compiled with the --warn option. The tool has many more options and is used by other build tools, like the aforementioned Gulp or Webpack.
This is not the place to go much deeper into the configuration of the different build tools, which would almost require a small book of its own. A development team will use what they are comfortable with. Build tools working together with scaffolding and editor plugins are the key to successfully implementing Elm applications that are bigger than a simple Hello World.
2 https://webpack.github.io/
3 https://www.npmjs.com/package/gulp-elm
4 https://www.npmjs.com/package/grunt-elm
5 https://github.com/paulmillr/chokidar
6 https://github.com/kimmobrunfeldt/chokidar-cli
93
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sita - Warrior of Mithila (Book 2 of the Ram Chandra Series) by Amish(53759)
The Crystal Crypt by Dick Philip K(36393)
Cat's cradle by Kurt Vonnegut(14726)
Always and Forever, Lara Jean by Jenny Han(14440)
Ready Player One by Cline Ernest(13934)
The Last by Hanna Jameson(9776)
Year One by Nora Roberts(9275)
Persepolis Rising by James S. A. Corey(8927)
The remains of the day by Kazuo Ishiguro(8351)
Never let me go by Kazuo Ishiguro(8267)
Red Rising by Pierce Brown(8221)
Dark Space: The Second Trilogy (Books 4-6) (Dark Space Trilogies Book 2) by Jasper T. Scott(7887)
The handmaid's tale by Margaret Atwood(7420)
The Circle by Dave Eggers(6818)
Frank Herbert's Dune Saga Collection: Books 1 - 6 by Frank Herbert(6672)
The Testaments by Margaret Atwood(6458)
Legacy by Ellery Kane(6373)
Pandemic (The Extinction Files Book 1) by A.G. Riddle(6160)
Six Wakes by Mur Lafferty(5793)
