David
David

Reputation: 4817

How to merge CSS and JS into HTML

I have 3 files, style.css, logic.js and container.html, while developing I need this files to exist separate, but when I am done, I'm searching for a tool that merges referenced css and js files into the HTML file:

<script src="./script/main.js"></script>
will turn into:

<script> ...code... </script>
and the same with CSS.

Is this possible? I first though this would be able with webpack, but the idea from webpack is not directly copying the content from the referenced files into the HTML file. Don't know if relevant, but I save my project on git and would like to run this build on bamboo, result of building my whole project should be one html file where all the code is inside, not being referenced, I could not find something that would do that?

Upvotes: 1

Views: 2055

Answers (1)

Bryce Howitson
Bryce Howitson

Reputation: 7690

Well a quick Google search gives me:

html-inline web-combiner

Upvotes: 2

Related Questions