1

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?

4
  • I think you could config webpack to do that, although I don't know how exactly. You could also just create a bash script that edits the .html file and copies the contents of the other files into it. Commented Feb 25, 2019 at 16:06
  • There are only 3 files. You can just copy-paste them within one minute. Commented Feb 25, 2019 at 16:06
  • @Mezo Istvan with bash I don't think the solution would be scalable. Commented Feb 25, 2019 at 16:09
  • @holydragon, the 3 files is only an analogy to showcase the issue. Commented Feb 25, 2019 at 16:09

1 Answer 1

2

Well a quick Google search gives me:

html-inline web-combiner

Sign up to request clarification or add additional context in comments.

3 Comments

hm, maybe I was searching with the wrong keywords, thanks, I will try them out.
My one useful skill is speaking Google... Glad I could help.
I tried out both and liked html-inline better since it does not requires C++ packages.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.