webpack expose-loader not working with jQuery -
in webpack config have following line expose jquery on global scope
{ test: require.resolve('jquery'), loader: 'expose?$!expose?jquery' },
i have file uses $. example:
.getscript(`${url}/scripts/test.js`) .done(() => { document.queryselector('#trustlogo_ph').innerhtml($.trustlogo(`${url}/content/themes/images/trustlogo.png`, 'sc4', 'none')); });
however, during webpack build, following error:
error '$' not defined no-undef
also, if put following directly in file:
require('expose?$!expose?jquery!jquery');
i error:
error unable resolve path module 'expose?$!expose?jquery!jquery' import/no-unresolved
according page, above should work: https://webpack.github.io/docs/shimming-modules.html.
i must missing something. advice?
Comments
Post a Comment