vigetlabs / blendid

A delicious blend of gulp tasks combined into a configurable asset pipeline and static site builder
MIT License
4.97k stars 682 forks source link

WordPress doesn't see js files in dev mode #479

Closed Blinks44 closed 7 years ago

Blinks44 commented 7 years ago

Hello! Thank you for such a great tool, but i have an issue with wordpress development. In development mode wordpress doesn't see js files with this code wp_register_script( 'app.js', get_template_directory_uri() . '/dist/javascripts/app.js', '', '', true ); But, it does after yarn run blendid -- build.

In dev mode i have to hardcode it in my footer.php to make it work and after development delete this code and build. <script src="/wp-content/themes/theme/dist/javascripts/app.js"></script>

Any suggestions ? Thx!

besimhu commented 7 years ago

@Blinks44 it's because of hot module reloading.

See our discussion on https://github.com/vigetlabs/blendid/issues/295

When you do a build, it essentially builds all files for production.

greypants commented 7 years ago

you want to use the proxy option of browserSync, and point it to your local wordpress url. https://browsersync.io/docs/options#option-proxy