B
B
betterthanyouthink2019-06-16 22:44:22
npm
betterthanyouthink, 2019-06-16 22:44:22

Webpack and php, is it possible?

Hello! The question is: in my project, I use the html webpack plugin, which generates html pages in the dist folder. I needed to add a piece of php code to the page. How can I make it all work?
There is almost no information on the Internet about this, really no one works with php files in Webpack? I'm new to Webpack, right now I only use it to build, compile sass, babel js. Php is primarily needed in order to load repeating sections on pages, for forms, etc. Now I'm stuck and can't go any further.
I would be glad for any help. Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Suha, 2019-06-16
@andreysuha

The html loader has an interpolation option. With PHP, you just need to include scripts and styles from dist via link and script manually

S
Stanislav-Vasilevich, 2021-04-06
@Stanislav-Vasilevich

Can you explain in more detail what and how to do it right?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question