Advertisement
Guest User

Untitled

a guest
Aug 10th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # webapp/resources/assets/js/testtest.js
  2. export default function bar() {
  3.     console.log("hello");
  4. }
  5.  
  6.  
  7.  
  8. # webapp/resources/assets/js/index.js
  9. import bar from './testtest';
  10.  
  11. bar();
  12.  
  13.  
  14.  
  15. # webapp\webpack.mix.js
  16. let mix = require('laravel-mix');
  17.  
  18. /*
  19.  |--------------------------------------------------------------------------
  20.  | Mix Asset Management
  21.  |--------------------------------------------------------------------------
  22.  |
  23.  | Mix provides a clean, fluent API for defining some Webpack build steps
  24.  | for your Laravel application. By default, we are compiling the Sass
  25.  | file for your application, as well as bundling up your JS files.
  26.  |
  27.  */
  28.  
  29. mix.js('resources/assets/js/index.js', 'dist/')
  30.  
  31.  
  32.  
  33. # webapp/index.html
  34. <script type="module">
  35.         import bar from './dist/index.js';
  36.  
  37.         bar();
  38. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement