Open jameswilddev opened 5 years ago
I think it would be ideal to use npm ci
instead of npm install
as it has a significant performance impact.
Good point! Fixed.
I'm also going to drop node_modules from the cache as npm ci deletes it anyway:
npm WARN prepare removing existing node_modules/ before installation
At present, laravel-mix does not run in CI. This means that, for instance, a broken commit or merge will not be detected until a developer tries running it locally.
This adds a script step to install NPM and run a production laravel-mix build. If any errors occur, this causes the build to fail. I suspect this was the original intention given that .travis.yml specifies that node_modules be cached, which is not populated as far as I am aware.
As part of this, I had to upgrade laravel-mix as 2.0 does not build on Travis CI (node-sass binding problems).
Note that there are still committed (development) JS and CSS files in the public directory; I am not certain what these are used for. As there is no deployment step, the artifacts produced by laravel-mix are discarded at the end of the build.