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.
I don't know much about this subject, but this looks possibly related: ArcGIS JSAPI setup build with Webpack for production (start reading from webpack.config.js) · GitHub
Yes. But they doesnt use the html webpack plugin.
I don't have time to fully test this but can you try add a paths for your dojoConfig.
var dojoConfig = {
paths: {
"app": "/app.js?add154b89f3e48308da"
}
};
That might work, but not sure.
I dont use dojo config, i integrate the lib using webpack.
externals: [
function(context, request, callback) {
if (/^dojo/.test(request) ||
/^dojox/.test(request) ||
/^dijit/.test(request) ||
/^esri/.test(request)
) {
return callback(null, "amd " + request);
}
callback();
}
],