tern icon indicating copy to clipboard operation
tern copied to clipboard

require.js + defs

Open wozjac opened this issue 4 years ago • 0 comments

Hi,

what should be the right config for such scenario below with require.js defs + type recognition?

define(["my/lib/Cart"],
    function(Cart) {
    var cart = new Cart(); 
    cart //<-- here I try to get the type of cart with "type" query

I want to bring my own definition of Cart with JSON type defiition - should it be done with override option of the requirejs plugin?

new tern.Server({
    "plugins": {
        "requirejs": {
            "override": {
                "my/lib/Cart": <my JSON type object>
...

or should it be with additional paths option?

new tern.Server({
    "plugins": {
        "requirejs": {
            "override": {
                "Cart": <my JSON type object>
            },
            paths: { "Cart": "my/lib" }
....

Regards, Jacek

wozjac avatar Mar 25 '20 20:03 wozjac