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
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 defaultnpm 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
- Adam Wathan (Adam is the inspiration behind this package (https://twitter.com/adamwathan/status/1205840365120561153))
License
The MIT License (MIT). Please see License File for more information.