just converted a project of mine from gulp to webpack 4. I have multi page set up with various entry points. Everything works great but I am unable to utilize the webpack html plugin for dependency injection as the site I am working on is running php.
Long story short I was hoping someone has some insight/advice on injecting the js bundles into a php file that are produced when I run a build utilizing webpack.
Gulp had something similar called gulp-inject which used a snippet/comment to insert scripts into an html page, grunt had something similar as well if I recall which was wire-dep.
Any advice would be greatly appreciated. Below I provided an example of what I am trying to accomplish.
Webpack config fragment:
entry: {
landing: './js/pages/landing.js',
about: './js/pages/about.js',
contact: './js/pages/contact.js',
}
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
}
In the php files I would love to do something like this or similar:
<!-- inject:js -->
<!-- js files will be automatically insert here -->
<!-- endinject -->