AnsweredAssumed Answered

Require javascript file with hash code

Question asked by endlessdsire on Oct 17, 2017
Latest reply on Oct 19, 2017 by endlessdsire

I wanted to know if there is a way to use require with a js generated by webpack using the html-webpack-plugin in hash mode.

 

Right now i require my file like:

<script type="text/javascript">require(["js/app.js"], function (app) {});</script>

 

But the html generated by webpack plugin is giving me this:

<script type="text/javascript" src="/app.js?add154b89f3e48308da7"></script></body>

 

So, how i do it if my file has a hash integrated?

 

I tried already this:

<script type="text/javascript">require(["js/app.js?add154b89f3e48308da7"], function (app) {});</script>

 

But it didnt work.

 

Thanks for the help.

Outcomes