You can run task
browserWebpack
to build bundle via webpack, which is ready to run in browser, and you can use
browserRun
to run it with hot reload
For testing in browser, you need to bundle all your dependencies in one js. By default gradle plugin do it for you (via webpack), but you need to declare javascript dependencies in gradle script
Another option, if it is plain js in your project (in resources for example), you need to say for webpack, where it should find your js
If you can share your project, it will simply to explain
But in common words, you can create
webpack.conf.d
folder and create plain js for configuring webpack
For example you can use
alias
(
https://webpack.js.org/configuration/resolve/#resolvealias)
Something like (relative path should be relative with base
build/js/packages/<your-module-name>
;(function () {
const path = require('path');
config.resolve = config.resolve || {};
config.resolve.alias = {
dependency: path.resolve(__dirname, 'path/to/dependency.js')
};
}());