PDA

View Full Version : Using npm packages inside an Ext JS Application - Not working in 7.2



annibale.x
6 Jul 2020, 2:10 PM
I followed exactly the guide Using npm - Adding npm packages (https://docs.sencha.com/extjs/7.2.0/guides/using_systems/using_npm/adding_npm_packages.html) on a fresh generated modern app (ExtJs 7.2)
but the moment npm package is not imported at all.
Seems the index.js file is skipped out by the build process for some reason.

Of course I've installed the required npm package (npm i --save moment in the node_modules directory).

my index.js file is simply:

//this file exists so the webpack build process will succeed
ModernApp.xMoment = require('moment') ;


but in the debugger console I still get undefined trying to reference the ModernApp.xMoment global variable.

What I wrong? There's some undocumented step that I miss? Or it's a bug?

dknezevic
26 Aug 2020, 1:11 AM
I have the same problem? how is this resolved in ExtJs 7? I can't seem to load any 3rt party NPM modules?
Anyone?