Javascript Wont Load After Compiling From PUG


#1

I’m using PUG (jade) and compiling it into HTML, aswell as JSX to JS.
However, when compiled, HTML wont load Javascript even though all files are present.

Pug code:

const styles = [
    "https://fonts.googleapis.com/css?family=Montserrat",
    "styles/index.css"
]
const scripts = [
    "https://code.jquery.com/jquery-3.3.1.min.js",
    "scripts/controller.js",
    "scripts/index.js"
]
html(lang='en')
  head
    meta(name='viewport' content='width=device-width, initial-scale=1.0')
    meta(http-equiv="content-type" content="text/html; charset=utf-8" )
    meta(charset='utf-8')
    title Game
    each style in styles
        link(rel="stylesheet" href=style)

  body
    div#root
    each script in scripts
        script(href=script)

When compiled, the scripts look like this:

<script href="https://code.jquery.com/jquery-3.3.1.min.js">
</script> <script href="scripts/controller.js"></script>
<script href="scripts/index.js"></script>

But in the code wont run, and it’s not shown in the Browser source.
the code is a simple:
console.log(“hello world”)
and all files are placed correctly.

Any insight would be helpful, as I’m a bit unfamiliar with gulp

Thank you :slight_smile: