Skip to main content
Version: 4.x

Frontend in BowPHP

Introduction​

Bow comes preconfigured with a Frontend environment, notably with Reacjs, Vuejs and Sass based on the laravel-mix package. This helps speed up the development of web applications.

Usage​

To start the compilation, go to the root of your application and type npm install or yarn install in your console, depending on the package manager you use.

Simple compilation​

Compiles the files defined in webpack.mix.js.

npm run dev

Compiling and minifying source files​

Compiles the sources defined in webpack.mix.js and optimizes the files.

npm run prod

Watching for file changes and recompiling accordingly​

This watches for changes to the files defined in webpack.mix.js and re-runs the compilation.

npm run watch

Running the code sniffer​

The code sniffer is a tool that formats your code, validates its quality, and reorganizes your code according to the development standard (here the standard is psr-2).

This command will also run format, which is a simple syntax validation tool for PHP.

npm run format

Webpack.mix.js​

webpack.mix.js is a file that lets you define the JavaScript, JSx, and Sass files to compile, and it comes preconfigured as follows:

mix.react('frontend/js/app.js', 'public/js')
.sass('frontend/js/app.scss', 'public/css');

For more information, see laravel-mix.

Is something missing?

If you run into problems with the documentation or have suggestions to improve the documentation or the project in general, please open an issue for us, or send a tweet mentioning the Twitter account @bowframework or directly on github.