hallvard
11/05/2020, 12:02 PMjs { moduleName = "myModuleName" } to adjust my module name, but according to the docs, this «_does not affect the webpacked output_». In the top of the produced .js file in my project, I find this: root["jsapi"] = factory(). Now how do I go about having Gradle change that string from the project name (jsapi) into something else?salomonbrys
11/05/2020, 12:59 PMkotlin {
  js {
    browser {
      webpackTask {
        outputFileName = "my-output.js"
      }
      runTask {
        outputFileName = "my-output.js"
      }
    }
  }
}hallvard
11/05/2020, 1:01 PMsalomonbrys
11/05/2020, 1:02 PMmoduleName.hallvard
11/05/2020, 1:02 PMsalomonbrys
11/05/2020, 1:05 PMhallvard
11/05/2020, 1:08 PMdoFirst { } clause in the jar task, but I was hoping the compile/build process could take care of this by itself, somehow.salomonbrys
11/05/2020, 1:09 PMhallvard
11/05/2020, 1:12 PMsalomonbrys
11/05/2020, 1:14 PMsalomonbrys
11/05/2020, 1:14 PMhallvard
11/05/2020, 1:27 PMgradle build results in a js file that starts like this:
(function webpackUniversalModuleDefinition(root, factory) {
        if(typeof exports === 'object' && typeof module === 'object')
                module.exports = factory();
        else if(typeof define === 'function' && define.amd)
                define([], factory);
        else if(typeof exports === 'object')
                exports["jsapi"] = factory();
        else
                root["jsapi"] = factory();
})(window, function() { ...
... and I thought setting the moduleName in the js { } block would do the trick for changing "jsapi" into my module name.hallvard
11/05/2020, 1:27 PM