Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # webapp/resources/assets/js/testtest.js
- export default function bar() {
- console.log("hello");
- }
- # webapp/resources/assets/js/index.js
- import bar from './testtest';
- bar();
- # webapp\webpack.mix.js
- let mix = require('laravel-mix');
- /*
- |--------------------------------------------------------------------------
- | Mix Asset Management
- |--------------------------------------------------------------------------
- |
- | Mix provides a clean, fluent API for defining some Webpack build steps
- | for your Laravel application. By default, we are compiling the Sass
- | file for your application, as well as bundling up your JS files.
- |
- */
- mix.js('resources/assets/js/index.js', 'dist/')
- # webapp/index.html
- <script type="module">
- import bar from './dist/index.js';
- bar();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement