Closed jedrzejchalubek closed 7 years ago
Import bootstrap scripts as module and compile separately with webpack.
// ./resources/assets/js/bootstrap.js import Bootstrap from 'bootstrap-sass'; // ./gulpfile.js mix.webpack('bootstrap.js')
Prepare resources/assets/js/theme.js boilerplate file and compile with webpack too.
resources/assets/js/theme.js
// gulpfile.js mix.webpack('theme.js')
Enqueue new files in src/Http/assets.php by default.
src/Http/assets.php
wp_enqueue_script('bootstrap', asset_path('js/bootstrap.js'), ['jquery'], null, true); wp_enqueue_script('theme-scripts', asset_path('js/theme.js'), ['bootstrap'], null, true);
Import bootstrap scripts as module and compile separately with webpack.
Prepare
resources/assets/js/theme.js
boilerplate file and compile with webpack too.Enqueue new files in
src/Http/assets.php
by default.