On Wednesday, September 28, 2016 at 8:18:26 AM UTC+1, Peter Damoc wrote:
There comes a point when you start needing to install tools with npm or bower.
One starts to need makefiles (like Fred used) or gulp/webpack.
If you use elm-reactor you get a build loop so localhost:8000 updates whenever you save the code.
I was just thinking, when moving on fro the reactor and creating your own grunt or gulp or whatever build, one of the first things you do is to set up a build loop.
As here:
This bit builds the elm files:
|
'elm': { |
| compile: { |
| files: { |
| 'app/style-lab.js': ['src/elm/**/*.elm'] |
| } |
| } |
| }, |
|
This bit runs the build loop watching for file changes:
'watch': { |
| 'dev': { |
| files: ['Gruntfile.js', 'bower.json', 'elm-package.json', 'server.js', 'config.rb', 'src/**'], |
| tasks: ['build'], |
| options: { |
| atBegin: true |
| } |
| },
|
This sets up the server and build loop:
grunt.registerTask('dev', ['bower', 'connect:server', 'watch:dev']);
So if you want to get started gulp, try getting just far enough to set up a build loop.
After that, you can start incorporating more stuff into the loop that does works outside of Elm itself. Minifying, transforming images, maybe css, bower, triggering tests, and so on.