I appreciate the answering, however it's still failing!
define('my-element', MyElement);
^
ReferenceError: define is not defined
at Object.<anonymous> (/home/karl/dev/javascript/sandbox.js:10:1)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11
I'm trying to run this in Node v12
From the looks of it you are using RequireJS? How would a pure JavaScript implementation look like?
My code is not fully working example ;) It's a most important part of the file. You still need to import the library. If you use some kind of bundler you can use this:
import{define}from'hybrids';...
If you want "pure" JS solution, you can use ES modules:
I appreciate the answering, however it's still failing!
I'm trying to run this in Node v12
From the looks of it you are using RequireJS? How would a pure JavaScript implementation look like?
My code is not fully working example ;) It's a most important part of the file. You still need to import the library. If you use some kind of bundler you can use this:
If you want "pure" JS solution, you can use ES modules:
Or for older browsers support:
Read more in Getting Started section of the library documentation.