0

we have a multipage application with below structure:

ApplicationModule is the root folder that contains all application logical modules,like Usermanagement and others like below:

/ApplicaationModules/UserManagement

//inside userManagement folder we have html pages and their corresponding .js(main)files //so we have like login.html and login.js

Login.js in turn requires/loads all script files that are required to execute the logic for the page, so it's configuration is like below:

require.config({

paths: {
    'jquery': '../../Scripts/jquery',
    'appSessionManager': '../../Scripts/ApplicationSessionManager',
    'appBasePage': '../../Scripts/ApplicationBasePage',
    'initServices': '../../IntegrationServices/Eservices/EservicesUserManagementService/Authenticate',
    'smUtility': '../../Scripts/SmartServicesUtility',
}}); 

require(['appSessionManager', 'appBasePage', 'initServices', 'smUtility', 'jquery'], 
function    (sessionManagerRef, basePageRef, eservicesRef, utilityRef) 

{ 
$(document).ready(function () {
//Here is the page code that uses other libraries like appSessionManager, appBasePage and others.
});
});

NOW, before moving to production, we want to use Optimizer so that all required files should be concatenated and minified as a single file.

Standing inside UserManagement folder, we run following command for the optimizer: node ../../r.js -o name=Login out=optimize.js

BUT it is giving us the below error:

Tracing dependencies for: Login Error: ENOENT, no such file or directory 'D:[some application path]\ApplicationModules\UserManagement\appSession Manager.js' In module tree: Login

Error: Error: ENOENT, no such file or directory 'D:[some application path]\ApplicationModules\UserManagement\app SessionManager.js' In module tree: Login

at Object.fs.openSync (fs.js:427:18)

Error is clear as for SessionManager.js file, it is trying to find it inside usermangement folder but I want it to look for this file inside Scripts folder as mentioned in config Paths of login.js file.

I will highly appreciate if someone can help us out on this.

0 Answers0