Search code examples
typescriptoraclemomentjsoracle-jet

Trouble implementing moment.js in Oracle Jet


i'm making an app using Oracle Jet in typescript.

I want to use the moment.js librairy but i have trouble implementing it.

To install it, I did npm install moment --save

In my .ts file I included it like that : import * as moment from 'moment';

But when I try to use it, it keeps sending this error : error image

Does anyone know how to implement it in the good way ? Thanks in advance


Solution

  • So in the end I found out how to do it correctly (at least it works for me)

    I just added this :

        "moment": {
          "cdn": "3rdparty",
          "cwd": "node_modules/moment",
          "debug": {
            "src": "moment.js",
            "path": "moment.js",
            "cdnPath": "moment.js"
          },
          "release": {
            "src": "moment.js",
            "path": "moment.js",
            "cdnPath": "moment.js"
          }
        },
    

    in src/js/path_mapping.json