Is any way to use Laravel-echo library without Laravel framework and NPM?
just use <script> tag and add library to my project.
            Asked
            
        
        
            Active
            
        
            Viewed 2,236 times
        
    8
            
            
         
    
    
        Cœur
        
- 37,241
- 25
- 195
- 267
 
    
    
        Mohammad Chavoshi
        
- 183
- 2
- 13
- 
                    Why would you? It's specific to Laravel. – Jeremy Harris Dec 02 '16 at 20:19
- 
                    2the fact is i want to use it without vue and gulp . output of the way that Documentation is describe is very heavy js file with a lot of unwanted library like Vue,webpack,bootstrap.scss,..... – Mohammad Chavoshi Dec 02 '16 at 20:24
1 Answers
5
            You can use the echojs without laravel and npm.
echojs is a Js library,
Follow these steps to create echo.js file:
import Echo from "laravel-echo"
window.Echo = Echo; // inject the echo js into the browser
compile this with gulp using following code
const elixir = require('laravel-elixir');
elixir(mix => {
    mix
       .webpack('echo.js','public/assets/js/echo.js');
});
You can use this public/assets/js/echo.js file in any projects.
If you're not comfortable with 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
 
    
    
        W2S Solutions
        
- 141
- 1
- 3
- 
                    For laravel 5.7 use `mix.js('echo.js', 'assets/js/echo.js')`. By default `mix` will point to "public", you can change it with `mix.setPublicPath()` – Theraloss Feb 27 '19 at 16:48