How can I use laravel echo without laravel and npm frame

Can I use the Laravel-echo library without the Laravel framework and NPM? just use the <script> and add the library to my project.

+6
source share
1 answer

You can use echojs without laravel and npm .

echojs is a Js library,

Follow these steps to create the echo.js file:

 import Echo from "laravel-echo" window.Echo = Echo; // inject the echo js into the browser 

compile this with gulp using the following code

 const elixir = require('laravel-elixir'); elixir(mix => { mix .webpack('echo.js','public/assets/js/echo.js'); }); 

You can use this file public / assets / js / echo.js in any projects.

If you do not like the above steps, go to our repository https://github.com/W2S-Solutions/laravel-echo-js-compiled/ and copy echo.js to use anywhere in your project

+2
source

Source: https://habr.com/ru/post/1012845/


All Articles