Laravel-mix: Ability to use `mix` in a non-interactive way?

Created on 17 Apr 2021  路  3Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: v6.0.16
  • Node Version: v14.7.0
  • Yarn Version: v1.22.5
  • OS: Mac OSX Big Sur, v11.2.3

Description:

Hey there! We use (and love) Laravel Mix in the Lucky framework for Crystal. We actually check for a manifest.json file at compile-time to help guarantee that assets you're requesting exist, which is really neat!

To that end, we have a script/setup Bash script that initializes your app and generates the manifest.json. Recently, running only mix seems to have started blocking the terminal for input, meaning that we could no longer use it in a Bash script or CI context.

We're thinking that the solution will be to simply run yarn prod (a wrapper script for mix --production), but it does seem a bit weird to run a production compilation in a development/CI environment just to get the manifest file.

Is there a way to run mix without blocking on input, or to generate only the manifest file?

Steps To Reproduce:

  • Run mix in a non-interactive environment (like GitHub actions)
  • Note that the mix command causes the workflow to hang

Here is the workflow on our website where we noticed the issue

Most helpful comment

馃う Thanks, @thecrypticace!

All 3 comments

Mix does not wait for input. You are using the in-preview Tailwind JIT engine which, by default, starts a watcher when NODE_ENV=development. To fix this set the TAILWIND_MODE=build env var.

馃う Thanks, @thecrypticace!

Happy to help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kpilard picture kpilard  路  3Comments

rderimay picture rderimay  路  3Comments

jpriceonline picture jpriceonline  路  3Comments

stefensuhat picture stefensuhat  路  3Comments

rlewkowicz picture rlewkowicz  路  3Comments