Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build JS and CSS in CI #37

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Build JS and CSS in CI #37

wants to merge 4 commits into from

Conversation

jameswilddev
Copy link
Contributor

@jameswilddev jameswilddev commented Aug 1, 2019

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.

@ash123456789
Copy link

I think it would be ideal to use npm ci instead of npm install as it has a significant performance impact.

@jameswilddev
Copy link
Contributor Author

Good point! Fixed.

@jameswilddev
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants