JSPM

laravel-mix-artisan-serve

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 66
  • Score
    100M100P100Q93426F
  • License MIT

Laravel Mix plugin to run `php artisan serve` by chaining `.serve()`

Package Exports

  • laravel-mix-artisan-serve

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (laravel-mix-artisan-serve) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Laravel Mix Artisan Serve

Latest Version on NPM Software License Total Downloads

This extension allows you to automatically serve your Laravel app with php artisan serve with Laravel Mix.
Please make sure that you are using laravel-mix version 4.0 or higher.

This package only runs when the --watch flag is passed such as with the default npm run watch command from a default Laravel install.

Usage

You can install the package with npm or yarn:

npm install laravel-mix-artisan-serve --save-dev
yarn add laravel-mix-artisan-serve --dev

Then require the extension in your Mix configuration:

const mix = require('laravel-mix');

require('laravel-mix-artisan-serve');
...

Enable the extension by calling .serve() at the end of your Mix chain:

mix.sass('resources/sass/app.scss', 'public/css').serve();

This will serve your Laravel application at http://localhost:8000 by default.

If you need to customize the host or port, you may pass an object to .serve():

mix.sass('resources/sass/app.scss', 'public/css').serve({
  host: '127.0.0.1',
  port: '3000',
});

And you're done!

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.