Hi! Does anyone know how to alias a JS module to a...
# javascript
s
Hi! Does anyone know how to alias a JS module to a folder within that npm installed module? For example
implementation(npm("ember-source", "3.12.0"))
will use the package main
node_modules/ember-source/lib/index.js
which is an installer script for Ember CLI but the actual front end libraries are located in
node_modules/ember-source/dist/
. Is there a way to have it consider a sub-folder of the module as the module? Or other suggestions? Thanks!
b
Copy code
@JsModule("ember-source/path/in/module's/sources")
external val smth:dynamic

// OR
external fun require(module:String): dynamic
fun main() {
  require("ember-source/path/in/module's/sources")
}
s
Oh rad, thank you!