MozaikAgency / wp-theme-starter

WordPress theme starter-kit, build tools included :smile:
MIT License
391 stars 70 forks source link

Scripts in 'vendor' folder are missing in the final built theme #270

Closed gopalraju closed 7 years ago

Maximilianos commented 7 years ago

Hey @gopalraju, 'vendor' scripts do not get automatically transferred into the built theme. You will need to require the individual scripts in one of your entry js files, such as ./dev_theme/assets/js/main.js. Something like the following:

// vendor scripts
import './vendor/path/to/awesome/lib';
import './vendor/path/to/other/awesome/lib';
...

// your scripts
import './scripts/path/to/even/better/custom/script';
...

Something like that. The idea is to serve concatenated bundles of javascript. If you want to split the bundle up into smaller packages consider either using multiple entry files, egmain2.js, or, even better, using webpack's code chunking/splitting

gopalraju commented 7 years ago

Thanks Max