I need to import a library to my project, the library should is a javascript file, which need to be inlined to html.
for example:
library code:
(function(){
var a = 0;
})();
I need to make this code inline in html.
html:
<html>
<head>
<script>
(function(){
var a = 0;
})();
</script>
</head>
<body>
</body>
</html>
can I implement this with webpack? I find script-loader, but it run the script, not make it inline.
@media, not with JS. But if there is JS you want to run before the<body>is parsed, add the<script>tag to the<head>instead.